I've been experiencing this strange issue with a couple of sites I've developed that whenever a form is submitted (any form on any of the sites) the $_POST variable appears to be empty. Which can be seen whenever I try to print it out. What appears to be happening is that the form is being submitted with a GET response rather than a POST, but I've definitely set the form method to POST (as shown) and this has only happened since my web host changed their server, and does not happen on my personal development box.
Code: Select all
<form id="catgeory_new" method="post" action="categoryform.php"
onsubmit="return checkCategory('new');">
</form>Code: Select all
$data = file_get_contents('php://input');Code: Select all
if(empty($_SERVER['CONTENT_TYPE'])){
$type = "application/x-www-form-urlencoded";
$_SERVER['CONTENT_TYPE'] = $type;
}Code: Select all
parse_str(file_get_contents('php://input'), $_POST);Tom