Re: Parsing AJAX post data -- The Way

From: Date: Thu, 25 Jan 2007 09:16:51 +0000
Subject: Re: Parsing AJAX post data -- The Way
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-247770@lists.php.net to get a copy of this message
M5 wrote:
Just wondering what smart people do for parsing data sent by the Javascript XMLHTTP object--e.g., http.send("post",url,true)... In a normal form submit, the $_POST global nicely allocates form elements as array elements automatically. But with the AJAX way, the data get stuffed inside $HTTP_RAW_POST_DATA as a string, thereby making extraction more tedious.
What format is the data you are posting in? If it's in the usual format, PHP should parse it for you. An AJAX (hate that acronym) post request is no different to a normal post, unless you are not posting in the form format (var1=val2&var2=val2). -Stut

« previous php.general (#247770) next »