Home > php教程 > php手册 > body text

asp防sql注入源程序

WBOY
Release: 2016-06-13 10:11:32
Original
851 people have browsed it

本文章免费提供一款asp防sql注入源程序看,方法比较简单就是接收query的值进行过滤哦。

本文章免费提供一款asp防sql注入源程序看,方法比较简单就是接收query的值进行过滤哦。

squery=lcase(Request.ServerVariables("QUERY_STRING"))
sURL=lcase(Request.ServerVariables("HTTP_HOST"))
SQL_injdata =":|;|>| SQL_inj = split(SQL_Injdata,"|")
For SQL_Data=0 To Ubound(SQL_inj)
if instr(squery&sURL,Sql_Inj(Sql_DATA))>0 Then
Response.Write "您的操作可能是SQL注入行为。"
Response.end
end if
next
%>

我自己觉得还有防sql注入的方法,那就是用trim()函数,去除所有querystring过来的值的空格,因为sql执行必须带有空格哦,还有如果是id类型的判断是否为数字就OK了。

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 Recommendations
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!