I searched several other similar questions, but none of them helped me out.
I'm working on a form that will post to a db using PHP, but the post data is not being sent. $_POST is an empty array, and file_get_contents('php://input') returns an empty string.
Here is an MWE.
HTML:
<!DOCTYPE html>
<html>
<head></head>
<body>
<div class="content">
<form action="formprocessor.php" method="post">
<label>Name: </label>
<input name="name" type="text" />
<label>Email: </label>
<input name="email" type="text" />
<input name="mySubmit" type="submit" value="Submit!" />
</form>
</div>
</body>
</html>
formprocessor.php:
<?php
ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
var_dump(file_get_contents('php://input')); //returns string(0) ""
//or
var_dump($_POST); //returns array(0) {}
echo $_POST;
?>
The html and php are in separate files in the same directory. After submitting this form, I get this in the browser:
string(0) "" array(0) { } Array
Running PHP 5.3.28 on Windows Server 2008
I am confident there is nothing wrong with the code, but probably something to do with the server or php configuration. Any direction there would be helpful.
I have checked the configuration file. The only setting I was able to identify that is relevant is post_max_size, which has the value 8M.
Here's what the Network tab shows on Chrome's developer tools after submitting the form: