If you use
Code:
<?php
header('Location: blahblah.com');
?>
in mid-HTML, you'll get a "Headers already sent" error.
To fix that, you'll have to use output buffering.
Example:
Code:
<?php
ob_start();
header('Location: blahblah.com');
ob_end_flush();
?>
This will buffer the PHP and execute any PHP scripts between the ob_start() and ob_end_flush() functions before it does anything else.
It's best to put ob_start(); as the very first piece of code on your page, and put ob_end_flush(); at the very end, therefore buffering (executing) the PHP before anything else.