This article introduces the method of solving the problem of automatic escaping character when the form post in PHP is passed, and there is a need for a friend reference to learn. Problem Description: The form input MySQL statement, and then submitted to the PHP program, the PHP program to do the corresponding query and return the results, when used to find that if you enter special characters in the form (such as "" \ "\ etc), PHP will automatically precede them with the escape character" \ ", but once it is added later, You can no longer use this statement for SQL queries. Workaround: Type in the form: SELECT * from device_information where Manager_team regexp ' Huawei ' After printing it, it becomes: SELECT * from device_information where manager_team regexp \ ' huawei\ ' In the view php.ini file, the value of the MAGIC_QUOTES_GPC option should be on. You might consider using the Stripslashes function to resolve. The above is the PHP form post parameters automatically add escape character problem resolution content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!
|