Form submission PHP form submission form name containing dot () will be converted to underscore (_)

Source: Internet
Author: User
Tags php form
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.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.