Code: Select all
header("Location: daily.php");regard,
Moderator: General Moderators
Code: Select all
header("Location: daily.php");There is no way of doing this with PHP. You'd have to use client-side redirecting using one of the following:jaylin wrote:when i usealthough the page is daily.php, the address in the address bar doesn't change and still "product.php". how can i fix it?Code: Select all
header("Location: daily.php");
regard,
Code: Select all
<meta http-equiv="refresh" value="0; http://example.com/" />Code: Select all
<script type="text/javascript">
top.location = 'http://example.com/';
</script>According to rfc2616 (HTTP protocol) responses with the status code of 302 (Found) mean:jaylin wrote:when i usealthough the page is daily.php, the address in the address bar doesn't change and still "product.php". how can i fix it?Code: Select all
header("Location: daily.php");
regard,
That's why user agent (browser) is free to leave old URI in address bar.rfc2616 wrote: 10.3.3 302 Found
The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests.
Code: Select all
header('HTTP/1.1 303 See Other');though I doubt many browsers would follow the standard that scrupulouslyrfc2616 wrote: The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource.
using die or exit after a header will just automatically send the header, if you don't then the page will execute, doing whatever sql queries there are then it will redirect. example:AGISB wrote: 2. use exit() after the header command. I do and it always works nicely although I think that might not be the problem.
Code: Select all
header("location: http://www.google.com");
header("location: http://www.yahoo.com");
die();