note 47031 deleted from function.header by betz
| From: | betz@php.net | Date: | Sun, 31 Oct 2004 17:10:25 +0000 |
| Subject: | note 47031 deleted from function.header by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79406@lists.php.net to get a copy of this message | ||
Note Submitter: ben johnson at manga revolution dot com
----
I think this is a very important thing to mention about headers (sorry if someone addressed this
above, I didn't have time to read each note thoroughly). If you use headers the way I do,
you'll be sending users to and from pages along with parameters. One of the most common
parameters I use is a simple status message. The problem I've noted is that some browsers
don't automatically urlencode() the parameters, and will leave spaces between characters,
instead of the %20 value. This causes the web browser to display an INVALID REQUEST message.
It has happened to me in Netscape and Safari. Very frustrating. Here's an example of what I
sent:
<?php header("some_page.php?msg=this is a status message generated by my scripts");
?>
The spaces between words are what cause the problem. I needed to fix it like this:
<?php header("some_page.php?msg=" .urlencode("this is a status message generated
by my scripts")); ?>
Of course there are cleaner methods of doing this, but you get the point. If I had known this at the
beginning of my project, I wouldn't have to waste time fixing everything. Hopefully this will
save some of you some headaches. =|
----
Reason: useless note