Home >Backend Development >PHP Tutorial >PHP检查浏览器参数防止被SQL注入的函数

PHP检查浏览器参数防止被SQL注入的函数

WBOY
WBOYOriginal
2016-06-20 13:03:551042browse

下面收集了一个函数是对浏览器的 URL 的字段内容进行过滤的,防止被 SQL 注入攻击用的。

<p>function inject_check($content){</p>	$check=eregi('select|insert|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file|outfile',$content);<br />	if($check){<br />		//echo "你输入的内容有可能对本站造成危害!";<br />		return true;<br />	}else{<br />		return false;<br />	}<br />}


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn