note 30361 rejected from function.urlencode by betz
| From: | betz@php.net | Date: | Sat, 15 Mar 2003 10:22:23 +0000 |
| Subject: | note 30361 rejected from function.urlencode by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-45344@lists.php.net to get a copy of this message | ||
I have called a Javascript function that pops up a window containing a PHP script to which a number
of arguments (variables) are passed.
One of the arguments is an array which has been serialized and thus contains quotation marks. In
order to call the Javascript function and pass this argument, it needs to be urlencoded. At the
other end, the argument is first urldecoded and then unserialized.
Everything works fine in Netscape 4.7 and Opera 7. However, InternetExplorer 6 and Netscape 7
urldecode the argument (even though the HTML page contains the urldecoded argument), causing the
call to the Javascript pop-up function to fail (because the call to the Javascript function and the
argument that is passed to the PHP script contain unbalanced quotation marks).
Is the automatic urldecoding in IE6 a Bill Gates special (and has Netscape 7 copied this), or am I
doing something wrong?
I worked around the problem by using base64_encode() to encode the serialized argument (and
base64_decode() at the other end), but this is rather unsatisfactory.
Has anyone else ever encountered the same problem or found another workaround?