The PHP form submission control name contains a period (.), which is converted to an underscore. Recently, when I was working on a company project, I found a strange problem. when I submitted a normal form, I found that the submitted value could not be obtained normally, I found a strange problem when I was working on a company project recently. I submitted a normal form and found that the submitted value could not be obtained normally, I was confused at the beginning. at the beginning, I thought it was a problem with my service and could not normally write data into the database. later I detected SQL statements and found that, the original problem occurred when obtaining data, and the obtained data was empty. later, a debug found that all the variables originally submitted to the backend were no longer the expected variables, it turned out to be 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.
...