Posted by Daniel Tryba on 07/01/05 16:32
melih.onvural@gmail.com wrote:
[extrenal request redirects to:]
> header("Location: http://localhost/nextpage.php");
>
> the proper form of redirection?
Well, Duh! localhost is the machine where the browser is running on.
Your friend connects to http://example.com/page.php and gets a redirect
to _his_ machine at http://localhost/nextpage.php.
The Q&D hack is to redirect to 'Location: nextpage.php', it violates the
HTTP rfc but in practice I have yet to see a browser that doesn't
redirect to the correct URL with this.
Better would be to redirect to "Location: http://{$_SERVER['HTTP_HOST']}/nextpage.php"
Navigation:
[Reply to this message]
|