Page 1 of 1

Redirect to a page or file

Posted: Thu Jun 27, 2002 2:04 pm
by conthox
How do i redirect a visitor to another page or file with PHP script :?:

Posted: Thu Jun 27, 2002 2:08 pm
by Patriot
try this:
<?php
header("Location: http://www.yoursite");
?>

if you want, you can use variables:

<?php
header("Location: $site");
?>
(go to http://yoursite.com/yourpage.php?site=h ... cation.com

remember:
do not print or write anything before the header tag!

this would not work:

<?php
print "hi!"
header("Location: $site");
?>