当前位置: 首页 > 图文教程 > 网络编程 > ASP > 好用的asp防SQL注入代码

ASP
asp中常用的文件处理函数
正确处理ASP动态网页中的容错机制
asp自动生成javascript检验函数
如何避免asp的SQL的执行效率低
编译asp应用程序成为exe文件
ASP完成小偷程序机制和简略示例
ASP技巧:rs.getrows方法
ASP简单实现数字字符混合验证码
ASP技巧 挂QQ的网页源代码ASP/PHP
ASP实例:用ASP判断文件地址是否有效
ASP实例:使用ASP生成图片彩色校验码
ASP如何跳出本次进入下一次循环
ASP读取数据库中数据到数组的类
为你的ASP程序作一个负载测试
如何用ASP来获取客户端真实IP的地址
asp脚本运行超时的解决办法
ASP缓存类 【先锋缓存类】Ver2004
ASP动态包含文件的改进方法
ASP中利用application实现缓存
ASP Application 对象用户手册

ASP 中的 好用的asp防SQL注入代码


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 51 ::
收藏到网摘: n/a

以下为引用的内容:
dim sql_injdata,SQL_inj,SQL_Get,SQL_Data,Sql_Post

SQL_injdata = "'|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.QueryString<>"" Then
For Each SQL_Get In Request.QueryString
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))>0 Then
Response.Write "<Script Language=javascript>alert('注意:请不要提交非法请求!');history.back(-1)</Script>"
Response.end
end if
next
Next
End If
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))>0 Then
Response.Write "<Script Language=javascript>alert('注意:请不要提交非法请求!');history.back(-1)</Script>"
Response.end
end if
next
next
end if