Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP $_POST is empty on IE9 and IIS7

Tags:

post

forms

php

iis

The following form causes an empty $_POST variable on IE9.

<form id='login' action='login.php' method='POST' accept-charset='UTF-8'>
<input type='text' name="username" id='username'  />
<input type='password' name='password' id='password' />
<input type="text" name="store" />
<input type='submit' name='Submit' value='Submit' />
</form>

The form works perfectly on Firefox and Chrome. All variables appear in the $_POST variable with no issues.

On IE9, however, the form is submitted properly, but $_POST is the empty array. I.e., in login.php:

print_r($_POST);

prints the empty array. I'm trying to figure out what could be different about IE9 that's making it behave differently from Firefox and Chrome and I can't figure it out.

I found mention of some module under Apache that's causing people problems, but I'm running IIS7, not Apache, so that's not it. Someone on a Ruby forum mentioned setting a DisableNTLMPreAuth to 1 in the registry, but that hasn't fixed it either.

Any help is appreciated.

like image 438
user1408141 Avatar asked May 21 '12 14:05

user1408141


1 Answers

accept-charset is not support in Internet Explorer. Remove it and see if that solves you're problem.

like image 154
Kao Avatar answered Oct 15 '22 17:10

Kao