Recently in the company project, found a strange problem, submitted a normal form, unexpectedly found unable to get the value of the submitted, this discovery, let me start the time confused, initially thought that my service has a problem, not normal write database, and then detect SQL statement found, The original problem occurred in the acquisition of data, the data obtained is empty, and then a debug found that the original submitted to the back end of all the variables, are not the expected variables, was converted by PHP.
Provide the test code as follows:
Copy the Code code as follows:
Test form Submission
if ($_post) {
Echo '
';
Var_export ($_post);
}
?>
code Example 1
After running the results are as follows:
Figure 1
As you can see, all of the. Numbers that I have in the control are converted by the back end into _ underline, in order to test some other symbols, so the test is done as above, so far, only the point number (.) is found. will be converted to an underscore (_), so it is not possible to find it in the back end when I take it for granted by Info.name, because it has actually been transformed into a info_name.
So in the future when you use the form, try not to use. Name.
The above describes the form submission PHP form submission Form name containing the dot () will be converted to underscore (_), including the form submission aspects, I hope to be interested in PHP tutorial friends helpful.