Today encountered a very mysterious problem, the user told me this side of the Web site to submit the form submitted to the query system after the return value, the query result is 0 records, but the results of local pure HTML execution can search the value. Verification of their own, and sure enough, and compared to the two sides get submitted parameters, in addition to the value of a field is different, the number of parameters these are the same, it is possible to consider the impact of coding problems.
Open two files after viewing, found that the two sides of the coding is really inconsistent, and the server side for GB2312, pass the UTF-8 encoded parameters can not be normally parsed out, so put the dog search, find the form on a very rarely used properties.
Copy Code code as follows:
Accept-charset= "Gb2312″
This property is interesting, you can set the form to encode what the content is encoded, so add this property to the form, just fine.
But it's disgusting, IE does not support this attribute, so we have to hack the onsubmit () method of the form, plus
Copy Code code as follows:
onsubmit= "document.charset= ' gb2312′;"
Solve the problem thoroughly.