Re: Parsing AJAX post data -- The Way
| From: | Richard Lynch | Date: | Thu, 25 Jan 2007 23:46:16 +0000 |
| Subject: | Re: Parsing AJAX post data -- The Way | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247800@lists.php.net to get a copy of this message | ||
On Thu, January 25, 2007 12:41 am, 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.
Call me crazy, but if AJAX is sending POST data correctly, your PHP
code shouldn't have to do anything special...
POST data is POST data.
The $HTTP_RAW_POST_DATA should be there as well, if you turned that
on, but that doesn't make $_POST go away.
--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?