xxxxxxxxxx
header("location: THE LOCATION"); //"THE LOCATION", put in a URL or directory to redirect to. For example, header("location: https://google.com/"); or header("location: ../../images/dog/");
xxxxxxxxxx
//PHP redirect
header("Location: https://www.codegrepper.com/my-redirect-page.php");
die();
xxxxxxxxxx
if (/*Condition to redirect*/){
//You need to redirect
header("Location: http://www.yourwebsite.com/user.php"); /* Redirect browser */
exit();
}
else{
// do some
}
xxxxxxxxxx
header("Location: http://example.com/redirect_page.php");
die(); //Force the script to quit, or you would raise an error...