Jump to content

$_POST, $HTTP_RAW_POST_DATA turns up empty


jakewins

Recommended Posts

I'm working on a project using the prototype javascript framework for AJAX-functionality. An hour ago, somewhere during transit, my POST-data started dissapearing. I'm suspecting it's either PHP or Apache messing up, because the problem has occured before when I've made changes to the php-side.

 

Changes like adding a variable assignment (something as simple as $myVar=12;) would suddenly render the $_POST-var empty. print_r'ing stuff would cause the same thing to happen. Not always though, but seemingly at random.

 

Now, however, I seem to have turned it into a permanent condition - the php-page processing the request is down to this:

 

<?php

print_r($_POST);

?>

 

And it still does not work. I found some similar stuff on the web, but in those cases, $HTTP_RAW_POST_DATA would contain the data, and the issue could be fixed by setting $_SERVER['CONTENT_TYPE'] = "application/x-www-form-urlencoded";  That has no effect here. However, $_SERVER['CONTENT_TYPE'] is empty, which shouldn't be the case.

 

Doing the request to the page through a form instead of through AJAX works fine - it's when prototype gets involved that it stops working. I checked the traffic going to the server, and everything is beeing sent properly - it just seems to dissapear when it reaches the server.

 

 

If anyone could help me with any leads it would be greatly appeciated!

Link to comment
https://forums.phpfreaks.com/topic/120799-_post-http_raw_post_data-turns-up-empty/
Share on other sites

i am not sure about the whole problem but i might be able to shed some light on the $_SERVER['CONTENT_TYPE'] problem i think you will only find this shows up if you tell the <form> tag that it is "application/x-www-form-urlencoded" like if you were uploading a file.

 

Scott.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.