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

WBOY
Release: 2016-06-20 13:03:55
Original
973 people have browsed it

下面收集了一个函数是对浏览器的 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 />}
Copy after login


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!