#39837 [Opn->Bgs]: POST improper handling of application/x-www-form-urlencode

From: Date: Sun, 17 Dec 2006 18:17:00 +0000
Subject: #39837 [Opn->Bgs]: POST improper handling of application/x-www-form-urlencode
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106440@lists.php.net to get a copy of this message
ID: 39837 Updated by: iliaa@php.net Reported By: miles at milespawski dot com -Status: Open +Status: Bogus Bug Type: Apache2 related Operating System: windows xp PHP Version: 5.2.0 New Comment: The url encoding is done by the browser not PHP. Previous Comments: ------------------------------------------------------------------------ [2006-12-14 23:49:56] miles at milespawski dot com Description: ------------ When sending POST data by xmlhttp-ajax method from jscript client to 2.2.3 apache server (PHP receipt container), the spaces in the data are not converted to "+" signs as they are supposed to be with MIME type application/x-www-form-urlencode. It worked before with older PHP and Apache. Apache.org sent me over here. I can get around this by doing a php str_replace(" ","+") to the data. Reproduce code: --------------- for the record: client (partial)- ====== var ops = "data_container.php?file="+ filenm + "&user=" + user + "&sid="+Math.random() xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); xmlhttp.onreadystatechange=loadSizes; xmlhttp.open('POST', ops, false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") xmlhttp.send("xx__val=" + Base64data); Server- <?php $file = $_GET['file']; $user = $_GET['user']; echo "<form name='form1' method='post' action='' enctype='multipart/form-data' target='_blank'>"; $pre_contents = $_POST['xx__val']; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39837&edit=1

« previous php.bugs (#106440) next »