When we want to move from one page to another we have to use page redirection here is a php code that deals with page redirection .Page redirection can be done in php page .sing header() which is used to send a raw HTTP header.
(i-e) header(“Location:newpage.php”); will load the newpage.php.
Note that header() must be used before sending any output either by HTML tags, blank lines or from PHP. Otherwise error message “header already sent” will be shown.
In this case, we can show a link for them go to the desired page.
Find below function written in PHP for doing page redirection by handling all the scenarios.
if (!headers_sent()) header(“Location:newpage.php”);
else echo “<script>window.location=\”newpage.php\”;</script>
<noscript>Automatic redirection didn’t work.<br />
<a href=\”newpage.php\”>Click here to go to newpage.</a></noscript>”;
If you want to use the variables of current page in the new page also, then include the new page (e.g include “newpage.php”;)instead of doing redirection.