PHP form submission control name contains the dot (.) will be converted into an underscore (_) processing method

Source: Internet
Author: User
Tags php form
During the project creation process, it was found that form submission was unsuccessful. later, it was found that the name of the control that I originally gave was invalid. after the control was submitted to the backend, it was found that all my control names contained. the name will be converted into an underscore after it is submitted _ a strange problem was found when I was working on a company project recently, submitting a normal form, I found that I could not normally get the submitted value. this discovery made me confused at the beginning. at first, I thought it was a problem with my service, I was unable to write data to the database normally. later I detected the SQL statement and found that the problem occurred when I got the data. the obtained data was empty. later I found that, all the variables originally submitted to the backend are not the expected variables, and are converted by PHP.

The test code is as follows:
The code is as follows:


Test form submission





If ($ _ POST ){
Echo'
'; 

Var_export ($ _ POST );
}
?>

Code Example 1
The result is as follows:



As you can see, all. are converted into _ underscores by the backend. in order to test other symbols, the above test has been conducted. so far, only the dot (.) has been found (.) will be converted to underscores (_), so I take info for granted at the backend. name cannot be accessed because it has been converted into info_name.

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.