I'm working on a website using XAMPP and for some unfathomable reason, $_POST is always empty, no matter what I try.
<form id="reg-form" method="post" action="check.php" enctype="application/x-www-form-urlencoded">
<label for="user" form="reg-form">Username: </label>
<input type="text" id="user" name="user" title="Username">
<br />
<label for="pass" form="reg-form">Password: </label>
<input type="password" id="pass" name="pass" title="Password">
<br />
<input type="submit" id="submit" title="Submit" value="Submit" form="reg-form">
</form>
And here's check.php:
<?php
if(empty($_SERVER['CONTENT_TYPE'])){
$type = "application/x-www-form-urlencoded";
$_SERVER['CONTENT_TYPE'] = $type;
}
var_dump($_POST);
print_r($_POST);
print_r($_GET);
$data = file_get_contents('php://input');
echo($data);
?>
And the output: array(0) { } Array ( ) Array ( ) user=test&pass=test
If I change the method to GET, the get array gets populated without problems.
I've checked php.ini, post is enabled, I have GCPS in variable_order, post_max_size is 8M, but I tried changing it around, didn't help.
I'm at my wit's end and no amount of googling seems to help. Am I overlooking something really simple?