xxxxxxxxxx
header("Location: https://example.com/myOtherPage.php");
die();
xxxxxxxxxx
//PHP redirect
header("Location: https://www.codegrepper.com/my-redirect-page.php");
die();
xxxxxxxxxx
<?php
// Perform a location redirect in PHP
$url = "https://example.com/new-location"; // The URL you want to redirect to
// Use HTTP response headers to perform the redirect
header("Location: " . $url);
exit(); // Stop further execution after the redirect
?>
xxxxxxxxxx
//PHP redirect
header("Location: https://www.codegrepper.com/my-redirect-page.php");
die();
xxxxxxxxxx
function Redirect($url, $permanent = false)
{
header('Location: ' . $url, true, $permanent ? 301 : 302);
exit();
}
Redirect('http://example.com/', false);
xxxxxxxxxx
<% String redirectURL = "http://domain.com/";
response.sendRedirect(redirectURL); %>
xxxxxxxxxx
if ( ) {
// I am using echo here.
} else if ($_SESSION['qnum'] > 10) {
session_destroy();
echo "Some error occured.";
// Redirect to "user.php".
}