I've having trouble with $_POST variables not being received from forms within a PHP website.
To clarify the problem, I created this simple PHP script "POST_test.php":
<?
print "POST:<pre>";
print_r($_POST);
print "</pre>";
?>
<form method="POST" action="POST_test.php">
<input type="submit" value="Save Changes">
<input type="hidden" name="blah" value="1">
</form>
Let's say my Apache web root is folder "web_root", and my website folder is "websiteA". Putting the above script in "web_root/websiteA" and clicking the button in IE7 results in an empty $_POST array. Changing the name of the folder to "web_root/websiteA2" makes it start working, and it also works in other websites within the web root, such as "websiteB". There's no issue when using Firefox. Recently, NTLM authentication was enabled in our systems - I don't know whether this might make a difference.
Apache & PHP run on a server running (a somewhat old version of) Debian Linux.
I've also tried a ctrl-refresh of the page in IE, which didn't help, and neither did rebooting my PC.
Update: This forum post appears to describe the issue: http://lists.rubyonrails.org/pipermail/rails/2006-March/027283.html
- You cannot post any data to mixed NTLM and non-NTLM authenticated Web sites. Microsoft Internet Explorer requires NTLM authentication for all visits to a website after you visit one NTLM authenticated folder of the website.
I can confirm this behaviour as follows:
When I visit http://mydomain/websiteA/index.php then http://mydomain/websiteA/POST_test.php $_POST is not populated by submitting the test page.
However, closing all my IE7 windows then browsing straight to http://mydomain/websiteA/POST_test.php shows $_POST IS populated by submitting the test page.
And one of the suggested solutions from the above linked forum post appears to be:
The only way I have seen to get IE to "forget" it has previously NTLM-authenticated to a site is to send a 401 page status. This effectively resets the IE authentication state.