A certain PHP page I have cannot read POSTed values. I have already read (and tried) suggestions from the following stack posts:
Can't get $_POST values (php, html)
I can't read my POST HTTP request's body with PHP !
I can prove that the posted values are coming from the sending PHP page. From the Network tab of Chrome dev tools:
Here is my code:
$firstName = trim($_POST["txtFirstName"]);
$lastName = trim($_POST["txtLastName"]);
$email = trim($_POST["txtEmail"]);
$phone = trim($_POST["txtPhone"]);
var_dump( $_POST );
echo "<br>";
print_r($_POST);
echo "<br>";
print_r($_REQUEST);
echo "<br>";
echo("firstName: $firstName" . "<br>");
echo("lastName: $lastName" . "<br>");
echo("txtFirstName: " . $_POST["txtFirstName"] . "<br>");
echo("txtLastName: " . $_POST["txtLastName"] . "<br>");
die();
And the results sent to the browser:
array(0) { }
Array ( )
Array ( )
firstName:
lastName:
txtFirstName:
txtLastName:
Here's a portion of the form from the submitting page:
<form method='post' action="Signup1.php" onsubmit="return checkForm(this)">
...
<input name='txtFirstName' id='txtFirstName' maxlength="25" type='text' />
...
</form>
As you can see, everything is blank/empty. I have worked with PHP form posts many times over the years and never had a problem like this. I'm running PHP 5.6.11 locally on my IIS machine.
My php scripts are in the same folder tree shared by an asp.net app (in a configured IIS application). When I move my php scripts out of that tree, everything works fine. Why should that matter, and what is causing the problem?
Any ideas?