PHP $ _POST is empty in IE9 and IIS7

The following form calls an empty $_POST variable in 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 great on Firefox and Chrome. All variables appear in the $_POST variable without any problems.

However, in IE9, the form appears correctly, but $_POST is an empty array. Ie, in login.php:

 print_r($_POST); 

prints an empty array. I am trying to understand what may be different from IE9, which makes its behavior different from Firefox and Chrome, and I cannot figure it out.

I found mention of some kind of module under Apache that causes problems with people, but I am running IIS7 , not Apache, so it is not. Someone at the Ruby forum mentioned setting the DisableNTLMPreAuth parameter to 1 in the registry, but that also did not fix it.

Any help is appreciated.

+6
source share
4 answers

accept-charset is not supported in Internet Explorer. Remove it and see if the problem solves you.

+1
source

I think this is due to a double hit - i.e. that IE is reloading the page in some way. Do you have client-side stuff (jQuery?) That reloads the page accidentally as an error? Try sending to a whole new page and draw <?PHP die ('<pre>'.print_r($_REQUEST,true).'</pre>');?> On the top line and see what happens.

0
source

plz enter the name attribute for the form.

 <form id='login' name='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> 
-1
source

The reason is that you do not support the session. Firefox and Chrome are very smart, and they maintain a session regardless of code development, which gives users good things. But in IE6-9 IE cannot support the session, the developer must check it, and if the session is not supported, each page loaded represents a new session and, therefore, there is no message.

-1
source

Source: https://habr.com/ru/post/916269/


All Articles