$_POST variables coming through empty in IE7 for one subfolder

前端 未结 4 1842
Happy的楠姐
Happy的楠姐 2021-01-15 14:30

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.p

相关标签:
4条回答
  • 2021-01-15 15:00

    This problem can be worked around by disabling pre-authentication in IE. In the registry:

    "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
    

    On the Edit menu, Add Value name DisableNTLMPreAuth as a type REG_DWORD and set the data value to 1 (true).

    For more information see this bug report and Microsoft KB 251404.

    0 讨论(0)
  • 2021-01-15 15:02

    Thanks for the suggestions.

    It turned out that the problem was caused by a previous request to an unrelated page which made use of NTLM authentication like this (or similar):

    <?php
      if (!isset($headers['Authorization'])){
        header('HTTP/1.1 401 Unauthorized');
        header('WWW-Authenticate: NTLM');
        exit;
      }
    ?>
    

    After that authentication was done, all $_POST data was received empty until IE was closed and re-opened. So far, I've worked around the issue by removing the above code and instead arranging for Apache to use NTLM within our Intranet (which sets the $_SERVER['REMOTE_USER'] variable). (Outside of our intranet, Apache authentication is still used).

    0 讨论(0)
  • 2021-01-15 15:11

    After working so hard i have found a trick for this problem. I used the whole ntlm authentication code as a include file in my php where the authentication is done and after that i can not make any form POST because of mixed-ntlm and non-ntlm issues which probably change the headers of the page.

    so what you have to do is just include the same ntlm authentication codes at the begining every pages of your site and that will do the trick.

    PROBLEM IS SOLVED... :)

    Hope this helps a lot of people.

    0 讨论(0)
  • 2021-01-15 15:14

    Try to fill your "action" attibute because I don't think will actually work to leave this attribut empty in IE7.

    0 讨论(0)
提交回复
热议问题