admin 发表于 2023-9-6 17:29

Uncaught Error: Call to undefined function get_magic_quotes_gpc()解决方法

Uncaught Error: Call to undefined function get_magic_quotes_gpc()解决方法

出现原因:
PHP版本6中 取消了get_magic_quotes_gpc()函数,首先这个函数的作用:是为了防止sql注入,当该函数打开时将所有单引号,双引号,反斜线和空字符转会自动转为含有反斜线的溢出字符。
PHP6取消magic_quotes机制,那么就是默认转义一些特殊字符来防止sql注入。

解决方案:
可以把源代码改为:(PHP_VERSION >= 6 || !get_magic_quotes_gpc())或者(PHP_VERSION < 6 && get_magic_quotes_gpc())

页: [1]
查看完整版本: Uncaught Error: Call to undefined function get_magic_quotes_gpc()解决方法