Forum Moderators: coopster
When I do:
header('Location: mypage.php?var=fred');
The browser (Firefox 2.0.0.3) get redirected and shows the following in the location bar:
[localhost...]
Notice that the "=" gets changed to ":%20"
Of course this is not working. I have tried everything I can think of, including using %3d instead of =. Nothing seems to work. Any ideas? Could this be a problem with PHP, or a problem with the web server in Proxy Plus, or something else? I have NOT tried this on any other web server.
header.php:
<?php
if(isset($_GET['test'])) echo "GET: {$_GET['test']}";
else header('Location: header.php?test=text');
?>
I use Mozilla, so the same what Firefox is based on. If it works for you, then the problem is sth else.
As I recall %20 means a blank space, so maybe here lies the problem?
Hope this sets you on the right track
Regards
Michal
[edited by: mcibor at 9:10 pm (utc) on May 8, 2007]
Note: HTTP/1.1 requires an absolute URI as argument to » Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER['HTTP_HOST'], $_SERVER['PHP_SELF'] and dirname() to make an absolute URI from a relative one yourself:
http:// is required for FireFox and other HTTP 1.1 complaint browsers.
Justin