function redirect($url) {
echo "";
echo "Redirecting in 3 seconds";
echo "<a href='$url' rel="nofollow">Click here if it does not redirect you</a>";
}
redirect("gotohere.php");
A simpler yet adjustable php function to redirect.
Don forget that the header function should be the first thing typed in, or you will have to turn on output buffering in your ini file or call this function, ob_start()
And use “UTF-8 without BOM” instead of “UTF-8” as your document encoding. Otherwise some “unnecessary” bytes will be send before PHP-interpreter will meet “” construction.
Thanks for sharing. Would like to share that we need to make sure there is no output sent before calling header function. Else it won’t work as expected.
It’s important to remember that this has to be the first output in the document for it to work. For examples, see the PHP Manual.
You should use
header(‘location:http//www.domain.dd’);
exit;
Wat about testin from a local server.
A simpler yet adjustable php function to redirect.
Don forget that the header function should be the first thing typed in, or you will have to turn on output buffering in your ini file or call this function, ob_start()
quick and dirty redirect (also if headers allready sent)
just call forceRedirect(‘http://www.domain.dd’);
And use “UTF-8 without BOM” instead of “UTF-8” as your document encoding. Otherwise some “unnecessary” bytes will be send before PHP-interpreter will meet “” construction.
how about redirect all the links in one page …
some give me a script ,plzz
This is the function that I’ve got in my library
Thanks for sharing. Would like to share that we need to make sure there is no output sent before calling header function. Else it won’t work as expected.