Posting from IE8 to PHP gives blank $_POST

前端 未结 5 681
失恋的感觉
失恋的感觉 2021-01-13 01:05

I have a simple HTML form, sending a post request to a php script. In IE8, the form only works intermittently - most of the time the PHP script sees an empty $_POST variable

5条回答
  •  情话喂你
    2021-01-13 01:52

    That sounds very very bizarre. Does it happen in other versions of IE as well?

    I can't tell you what the problem is, but here are my suggestions on how to diagnose it:

    1. Print $_REQUEST rather than just $_POST, to see if the data is coming in via another method.

    2. Use a tool like Fiddler or Wireshark to track exactly what is actually being sent by the browser.

    Fiddler in particular has been very helpful for me a few times (mainly when debugging Ajax code), and will tell you exactly what was posted by the browser. If your web server is localhost, you can also use Fiddler to track what is received before PHP gets its hands on it. If not, you can use wireshark on the server if you have permissions for installing that sort of thing.

    In addition to Fiddler, I would have suggested a browser-based tool like Firebug, but I don't know of one for IE that is good enough (The IE dev toolbar doesn't give you details of request and response data, as far as I know).

提交回复
热议问题