PHP头条
热点:

php 防止sql注入代码


php教程 防止sql注入代码

*/ 

 function inject_check($sql_str) { //防止注入
  $check = eregi('select|insert|update|delete|'|/*|*|../|./|union|into|load_file|outfile', $sql_str);
  if ($check) {
   echo "输入非法注入内容!";
   exit ();
  } else {
   return $sql_str;
  }
 }
 function checkurl() { //检查来路
  if (preg_replace("/https教程?://([^:/]+).*/i", "1", $_server['http_referer']) !== preg_replace("/([^:]+).*/", "1", $_server['http_host'])) {
   header("location: http://www.zhutiai.com");
   exit();
  }
 }

//调用
checkurl();
$str = $_get['url'];
inject_check($sql_str);//这条可以在获取参数时执行操作

www.phpzy.comtrue/php/5125.htmlTechArticlephp 防止sql注入代码 php教程 防止sql注入代码 */ function inject_check($sql_str) { //防止注入 $check = eregi('select|insert|update|delete|'|/*|*|../|./|union|into|load_file|outfile', $sql_str); if ($check) { echo 输入非法注...

相关文章

    暂无相关文章
相关频道:

PHP之友评论

今天推荐