Quote:
Originally Posted by ioulios
PHP Code:
<?php
//Redirect Message
echo "You will be automatically redirected to a new location.<br>\n";
echo "If your browser does not redirect you in 10 seconds, or you do not wish to wait, <a href=\"http://www.domain.tld/new-page.php\">click here</a>.\n";
//Redirect to new page
header('Refresh: 10; URL=http://www.domain.tld/new-page.php');
?>
or
PHP Code:
<?php
//Redirect Message
echo "You will be automatically redirected to a new location.<br>\n";
echo "If your browser does not redirect you in 10 seconds, or you do not wish to wait, <a href=\"http://www.domain.tld/new-page.php\">click here</a>.\n";
//Redirect to new page
$start = time();
$end = $start + 10;
while (time() < $end) {
header('Location: http://www.domain.tld/new-page.php');
}
exit();
?>
|
The above code may return errors, when using a header function after any blank spaces, black lines or html code. If you do experience any header errors, use:
PHP Code:
<?php
ob_start();
//Redirect Message
echo "You will be automatically redirected to a new location.<br>\n";
echo "If your browser does not redirect you in 10 seconds, or you do not wish to wait, <a href=\"http://www.domain.tld/new-page.php\">click here</a>.\n";
//Redirect to new page
$start = time();
$end = $start + 10;
while (time() < $end) {
header('Location: http://www.domain.tld/new-page.php');
}
exit();
ob_flush();
?>