note 50341 deleted from function.header by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 09:49:16 +0000 |
| Subject: | note 50341 deleted from function.header by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106723@lists.php.net to get a copy of this message | ||
Note Submitter: php at richardneill dot org
----
Warning about Query strings in header: Location.
Normally, when using ampersands in a query string, '&' is wrong, and
'&' is right. [see http://www.htmlhelp.com/tools/validator/problems.html#amp
]
Eg: This is the correct way to write a link: <a href="http://example.com/index.php?foo=bar&baz=wombat">link</a>
BUT, when writing a redirect, the exact reverse seems to be true. The following is wrong (It
doesn't work in either Mozilla or Konqueror - in both cases, the value of baz is not set):
$redirect_location = 'http://example.com/index.php?foo=bar&baz=wombat';
header("Location: $redirect_location");
In this case, it seems as though '&' is necessary.
I'm fairly sure of this, through experiment, but I don't know why it should be true. It
seems a bit perverse!