Redirect and Refresh
For redirecting a page we use a simple command header().
the command header can be used in two ways to redirect a web page
one is redirecting using location, another one is refresh
1 . Example of header(”Location: ..)
<?php
header(”Location: http://www.php.net”);
?>
the above code will redirect you to php.net immediately on reaching the header
command and the constraint is nothing should be outputted before using header().
2 . Example of header(”refresh: ..)
<?php
header( ‘refresh: 5; url=http://www.youdomain.com/welcomeuser.php’ );
echo ‘Your content are successfully registered’;
?>
the above code will output the content below header() and then refresh or
redirect the page after 5 seconds
