一个ASP防止SQL注入的函数

作者: 小古 分类: 网站技术 发布时间: 2012-1-5 ė8902 次浏览 63 条评论

在这里也不做说明了,大家也应该会用的!

<%
Function sqlzr1(ParaName)
if IsNumeric(ParaName)  then
    SafeRequest=ParaName
    exit Function
else
    ParaValuetemp=lcase(ParaName)
    tempvalue="select|insert|delete|union|join|script|applet|object|'|drop|update|truncate|create|xp_cmdshell|exec|alter|cast|rename|modify"
    temps=split(tempvalue,"|")
    for mycount=0 to ubound(temps)
    if  Instr(ParaValuetemp,temps(mycount)) > 0   and lcase(ParaName)<>"module" then
        Response.Write "<script language='javascript'>"
        'Response.Write "alert('您提交的内容包含了字符["&temps(mycount)&"],请去除后重新提交或联系我们...');"
        Response.Write "alert('非法的请求!');"
        Response.Write "</script>"
        Response.end
    end if
    next
    sqlzr1=ParaName
end if
End function
response.write sqlzr1("gdhrhrhj")
%>

本文出自 小古Blog,转载时请注明出处及相应链接。

本文永久链接: http://blog.chdz1.com/?post=132

|

3条评论

  1. 笑草先生、 2012-04-24 00:34

    UC1.6过时了。现在用UC2.1回复

  1. wuhao2163256 2012-04-05 17:09

    您好  我是在论坛上看到您的博客的  主要是因为shopex和UC及其他程序整合不能同进同出  想请教下您 看能不能直接把教程发我邮箱 460365766@qq.com  谢谢大哥了回复

  1. 安份 2012-01-11 15:21

    想找你要一份,UC1.6和shopex 整合的文件。谢谢哦。。。65772006@qq.com回复

发表评论:

电子邮件地址不会被公开。 必填项已用*标注

Ɣ回顶部
sitemap