Re: Bug? Raw POST data in PHP 5.2.2, take two
| From: | Dirk Haun | Date: | Sat, 05 May 2007 08:04:08 +0000 |
| Subject: | Re: Bug? Raw POST data in PHP 5.2.2, take two | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-29206@lists.php.net to get a copy of this message | ||
Ilia Alshanetsky wrote:
>Also, have you tried accessing the data from php://input ?
Okay, that appears to work. Using this script as the receive.php:
<?php
echo (file_get_contents("php://input"));
?>
I now get
---GOT---
HTTP/1.1 200 OK
Date: Sat, 05 May 2007 08:01:49 GMT
Server: Apache/1.3.37 (Unix) PHP/5.2.2
X-Powered-By: PHP/5.2.2
Connection: close
Content-Type: text/html
<?xml version="1.0" encoding="UTF-8"?>
<methodCall>
<methodName>pingback.ping</methodName>
<params>
<param>
<value><string>http://www.example.com/</string></value>
</param>
<param>
<value><string>http://www.example.com/</string></value>
</param>
</params>
</methodCall>
---END---
So the raw post data is available via php://input but not via
$HTTP_RAW_POST_DATA or $GLOBALS['HTTP_RAW_POST_DATA'].
Also, this problem only affects PHP 5.2.2. Things are working fine with
PHP 4.4.7.
bye, Dirk
--
http://www.geeklog.net/
http://geeklog.info/