This article introduces how to solve the problem of automatically escaping characters when passing parameters through form post in php. if you need it, refer to it. Problem Description: input the mysql statement in the form and submit it to the PHP program. The PHP program performs the corresponding query and returns the result, during use, PHP automatically adds the escape character "\" to the front of the special characters (for example, ''" \ ") in the form "\", however, once it is added, you cannot use this statement for SQL queries. Solution: in the form, enter: Select * from device_information where manager_team regexp 'Huawei' After printing, it becomes: Select * from device_information where manager_team regexp \ 'Huawei \' Check that the value of the magic_quotes_gpc option in the php. ini file is on. You can consider using the stripslashes function. The above is the solution to the problem of automatically adding escape characters when passing parameters in PHP form POST. For more information, see PHP Chinese website (www.php1.cn )!
|