magic_quotes_gpc设置是否自动为GPC(get,post,cookie)传来的数据中的\'\"\\加上反斜线。可以用get_magic_quotes_gpc()检测系统设置。如果没有打开这项设置,可以使用addslashes()函数添加,它的功能就是给数据库查询语句等的需要在某些字符前加上了反斜线。这些字符是单引号(\')、双引号(\")、反斜线(\\)与 NUL(NULL 字符)。


一般用法如下;
if(!get_magic_quotes_gpc())
{
    addslashes($prot);
}


一般用法如下;
if(!get_magic_quotes_gpc())
{
    addslashes($prot);
}

相关文章:

  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
猜你喜欢
  • 2021-08-12
  • 2021-09-05
  • 2021-11-28
  • 2021-11-19
  • 2021-06-19
  • 2021-06-16
  • 2021-07-05
相关资源
相似解决方案