See :
http://www.php.net/manual/en/function.header.php
Examples exist there, such as :
header ("Location: http://www.php.net");
Be sure to not have output above this statement so for example the following will give an error (see user comments within manual) :
print 'foo';
header ("Location: http://www.php.net");
But you CAN do something like this as it does not involve output :
$a = 'foo';
if ($a == 'foo') {
header ("Location: http://www.php.net");
}
It will all make sense very soon :-) If you must output stuff beforehand, look into "output buffering" although that is NOT optimal and usually causes unneeded work on server.