note 30361 added to function.urlencode

From: Date: Sat, 15 Mar 2003 10:21:14 +0000
Subject: note 30361 added to function.urlencode
Groups: php.notes 
Request: Send a blank email to php-notes+get-45342@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? -- http://www.php.net/manual/en/function.urlencode.php http://master.php.net/manage/user-notes.php?action=edit+30361 http://master.php.net/manage/user-notes.php?action=delete+30361 http://master.php.net/manage/user-notes.php?action=reject+30361

« previous php.notes (#45342) next »