php语言

discuz的php防止sql注入函数

时间:2025-05-10 04:58:00 php语言 我要投稿
  • 相关推荐

discuz的php防止sql注入函数

  分享一下discuz论坛的sql防注入函数,写的不错。就跟随百分网小编一起去了解下吧,想了解更多相关信息请持续关注我们应届毕业生考试网!

  复制代码 代码如下:

  $magic_quotes_gpc = get_magic_quotes_gpc();

  @extract(daddslashes($_COOKIE));

  @extract(daddslashes($_POST));

  @extract(daddslashes($_GET));

  if(!$magic_quotes_gpc) {

  $_FILES = daddslashes($_FILES);

  }

  function daddslashes($string, $force = 0) {

  if(!$GLOBALS['magic_quotes_gpc'] || $force) {

  if(is_array($string)) {

  foreach($string as $key => $val) {

  $string[$key] = daddslashes($val, $force);

  }

  } else {

  $string = addslashes($string);

  }

  }

  return $string;

  }

【discuz的php防止sql注入函数】相关文章:

php防止sql注入漏洞过滤函数的代码08-22

PHP面试之php自带的几个防止sql注入的函数06-14

php防止SQL注入的方法10-13

php怎么防止sql注入10-15

php中防止SQL注入的方法06-16

php防止SQL注入的方法分享09-29

PHP中该怎样防止SQL注入05-23

在PHP中该怎样防止SQL注入07-25

php中防止SQL注入的解决方法11-04