小古Blog
一个ASP防止SQL注入的函数
2012-1-5 小古

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


<%

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")

%>
评论:
笑草先生、
2012-04-24 00:34 回复
UC1.6过时了。现在用UC2.1
wuhao2163256
2012-04-05 17:09 回复
您好  我是在论坛上看到您的博客的  主要是因为shopex和UC及其他程序整合不能同进同出  想请教下您 看能不能直接把教程发我邮箱 460365766@qq.com  谢谢大哥了
安份
2012-01-11 15:21 回复
想找你要一份,UC1.6和shopex 整合的文件。谢谢哦。。。65772006@qq.com
发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容