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. it is converted into an underscore after it is submitted _
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. it is converted into an underscore after it is submitted _
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 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.