<?php
header("Location: (redirect url)");
?>
header("Location: http://example.com");
die();
header("Location: pagetoredirectfor.php");
exit();
< ?php header("Location: http://www.redirect.to.url.com/"); ?>
<?php header ("location: http://domain.com/"); ?>
header("Location: /");
exit();
if (/*Condition to redirect*/){
//You need to redirect
header("Location: http://www.yourwebsite.com/user.php"); /* Redirect browser */
exit();
}
else{
// do some
}
<?php header("Location: $url"); ?>
<php
header("location: http://www.yoursite.com");
?>
header("Location: http://example.com/redirect_page.php");
die(); //Force the script to quit, or you would raise an error...
function Redirect($url, $permanent = false)
{
header('Location: ' . $url, true, $permanent ? 301 : 302);
exit();
}
Redirect('http://example.com/', false);
header("Location: home.php");
//PHP redirect
header("Location: https://www.codegrepper.com/my-redirect-page.php");
die();
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/");
function location($where){
echo '<script>window.location.href="'.$where.'"</script>';
}
location("https://youtube.com");
<% String redirectURL = "http://domain.com/";
response.sendRedirect(redirectURL); %>
if (...) {
// I am using echo here.
} else if ($_SESSION['qnum'] > 10) {
session_destroy();
echo "Some error occured.";
// Redirect to "user.php".
}