Magic_quotes_gpc is not enabled for PHP. if single quotes or other characters appear in GET and POST data, data cannot be added. this problem can be solved by using addslashes. Magic_quotes_gpc is not enabled for PHP. if single quotes or other characters appear in GET and POST data, data cannot be added. this problem can be solved by using addslashes.
By default, the PHP command magic_quotes_gpc is on, which runs automatically on all GET, POST, and COOKIE data.
Addslashes (). Do not use strings that have been escaped by magic_quotes_gpc
Addslashes ()Because it causes double-layer escape. In this case, you can use the function
Get_magic_quotes_gpc ().
For example:PHP code
- If (! Get_magic_quotes_gpc ()){
- $ Title = addslashes ($ _ POST ['title']);
- } Else {
- $ Title = $ _ POST ['title'];
- }
First, check whether magic_quotes_gpc is enabled. if not, call addslashes (). If the method is enabled, assign values directly.