HTML_RAW_POST_DATA .. testing xform submit

liunx

Guest
Note:
tried to correct the typo error in title in main forum index
from ..
HTML_RAW_POST_DATA .. testing xform submit
to ..
HTTP_RAW_POST_DATA .. testing xform submit

but could not edit title after posting ..
___________________________________________

Problem:

I am trying to echo the login submission from an xform .. following this tutorial ..

<!-- m --><a class="postlink" href="http://www.sitepoint.com/blogs/2005/10/27/cross-browser-xforms/">http://www.sitepoint.com/blogs/2005/10/ ... er-xforms/</a><!-- m -->

The PHP code in the submit.php is ..


echo htmlentities($GLOBALS['HTTP_RAW_POST_DATA']);


and in php.ini ..

register_globals = On;
and
always_populate_raw_post_data = On;

....

On xform submission this does not work .. returns HTTP status 501 ..

But the correct xform xml data is being posted (monitored by Fiddler HTTP Proxy Tool).

....

This PHP5 changelog

<!-- m --><a class="postlink" href="http://php.inspire.net.nz/ChangeLog-5.php">http://php.inspire.net.nz/ChangeLog-5.php</a><!-- m -->

says .. "Fixed bug with $HTTP_RAW_POST_DATA not getting set. "


I've just upgraded from PHP-5.0.2 to PHP-5.1.4 .. and it still returns HTTP Status 501

"The server does not support the functionality needed to fulfill this request ()."

_______________________________________________________

p.s.

Inspecting the HTTP Request with Fiddler HTTP Proxy Tool (<!-- m --><a class="postlink" href="http://www.fiddlertool.com">http://www.fiddlertool.com</a><!-- m -->) this is the request information sent to submit.php .. seen in Fiddler Session Inspector ..

Raw:

Content-Type: application/xml; charset=UTF-8
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; formsPlayer 2.0; Sidewinder 1.0; SV1; Maxthon; .NET CLR 1.1.4322)
Host: localhost:8080
Content-Length: 131
Proxy-Connection: Keep-Alive
Pragma: no-cache

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<login>
<username>alpha</username>
<password>beta</password>
</login>

...

and

Forms:

= BODY ====
This request contains a body, but it is not of Content-Type: application/x-www-form-urlencoded.


....

The FORM posting script index.php has this at the top of code ..


// Send true XHTML to browsers that request it
if (stristr($_SERVER['HTTP_ACCEPT'], 'application/xhtml+xml')) {
header('Content-type: application/xhtml+xml');
}

DLI placed submit.php in a remote PHP server (PHP-5.0.2) to test posting xform data .. and HTTP_RAW_POST_DATA responded with correct results ..

so it looks like I have some problem in my localhost PHP configuration / php.ini.

______________________________________

Later edit ..

got HTTP_RAW_POST_DATA to echo in the localhost Apache+PHP server by reverting to a clean version of php.ini ..

strangely it works with these default settings in php.ini

always_populate_raw_post_data = Off
register_globals = Off

I thought that these should be both "On". ????

Now I'll gradually update php.ini to see if/where it breaks.
 
Back
Top