It\'s often useful to redirect to another page, such as when submitting a contact form and redirecting. As a note when you are redirecting to another page using this code you cannot have any html tags or echo tags on the page. These will cause an error about headers already being outputted...., if you get this error it is most likely because you our outputting text or html to the user.
The code below simply direct the user to a page located at http://www.mootazdevelopment.com/contact/thankyou.php
<?
$extra = \'contact/thankyou.php\'
?>
The code below well grab the current domain address and the $extra variable contains the location of the thank you page from there.
<?
$host = $_SERVER[\'HTTP_HOST\'];
$extra = \'contact/thankyou.php\';
header("Location: http://$host$uri/$extra");
?>
The code below well grab the current domain address and the specific directory that you are in.
<?
$host = $_SERVER[\'HTTP_HOST\'];
$uri = rtrim(dirname($_SERVER[\'PHP_SELF\']), \'/\\\\\');
$extra = \'thankyou.php\';
header("Location: http://$host$uri/$extra");