I wrote
<?
header("Location:http://example.com");
?>
but Redirect is not occured. How to redirect?
But I do not have authority to edit php.ini So safe_mode is on in php.ini
I wrote
<?
header("Location:http://example.com");
?>
but Redirect is not occured. How to redirect?
But I do not have authority to edit php.ini So safe_mode is on in php.ini
Try:
header("Location: http://example.com");
HTTP headers need to exactly follow the spec. More directly here (Location header):
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
Hi
One possible issue is that there was something got "printed out" before you issue the above code. So check your code so that there is nothing got "echoed" before reached this line.
Two things:
See this post for more detailed information.
You can also use JavaScript to do the redirect but I suspect PHP is probably a better idea in your situation.
Make sure you alway add die() after the header() call. This is extremely important if anything is output below the header() that the user is not supposed to see.
Alternatively, use:
<meta http-equiv="refresh" content="0;url=http://foo.com">
somewhere in your <head>
section.