RE: [PHP-DEV] Ramsus: Post Vars?
| From: | John Coggeshall | Date: | Mon, 24 Jul 2000 18:48:03 +0000 |
| Subject: | RE: [PHP-DEV] Ramsus: Post Vars? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-25642@lists.php.net to get a copy of this message | ||
> $first=1;
> while(list($k,$v)=each($HTTP_POST_VARS)) {
> if($first) $data = urlencode($k) . '=' . urlencode($v);
> else $data .= '&' . urlencode($k) . '=' . urlencode($v);
Forgot $first=0;
; )
> Now $data would contain the original posted data string. There are some
> broken applications out there that do not send POST data in
> application/x-www-form-urlencoded nor multipart/form-data (which is a file
> upload). For these apps PHP gives up trying to parse the data and just
> makes the raw data available in $HTTP_RAW_POST_DATA.
> I believe this is the correct and efficient way to treat posted data and
> have yet to see a decent argument counter to that.
That's what I figured, that the raw data was destroyed when it was parsed. I
guess, for this particular instance MSIE, in a special circumstance
(uploading favs. I think?), sends data to the server without following
form-urlencoded standards (just text). The question origionally was how to
get at this data as-was without parsing. I guess in this case the answer is
to undo the work the parser did and reconstruct the data yourself. Makes
sense, and was probably the best way to do it anyway....
Thanks
John