In this artcle we are explaining how to redirect a php page to another location, Sometimes we need to redirect our php page to another after executing some code. For example , redirect to dashboard page after login check process
Step1 : Prerequisite
Make sure that, there is no white space in the first line of the php file. Basically we have to makesure that nothing is printing to buffer before redirect.
Redirect Function call
Use the php function called
headerto redirect to another url.
Terminate the current script
exit();function to terminate the current script
<?php // write your codes before start the redirection