| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 627 人关注过本帖
标题:注册提交时因为SQL防注入过滤导致无法注册,怎么处理?
只看楼主 加入收藏
keke2002
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-11-21
收藏
 问题点数:0 回复次数:0 
注册提交时因为SQL防注入过滤导致无法注册,怎么处理?
大家好,我是个新手,近日在调试一个程序时,注册时频繁出现提示操作不成功的警告,检查了一下,发现是在conn.asp的SQL防注入部分出现的问题,但不知怎么解决,想请教下啊!!!!
附注册截图:

图片附件: 游客没有浏览图片的权限,请 登录注册

以下是conn.asp文件代码:
<%@ LANGUAGE = VBScript.Encode %>
<%
'检测是否有效的数字-----------------
Function IsInteger(Para)
    IsInteger=False
    If Not (IsNull(Para) Or Trim(Para)="" Or Not IsNumeric(Para)) Then
        IsInteger=True
    End If
End Function
'检查无效字符----------------------
Function CheckStr(byVal ChkStr)
    Dim Str:Str=ChkStr
    Str=Trim(Str)
    If IsNull(Str) Then
        CheckStr = ""
        Exit Function
    End If
    Dim re
    Set re=new RegExp
    re.IgnoreCase =True
    re.Global=True
    re.Pattern="(\r\n){3,}"
    Str=re.Replace(Str,"$1$1$1")
    Set re=Nothing
    Str = Replace(Str,"'","''")
    Str = Replace(Str, "!!!", "!")
    Str = Replace(Str, "★★★", "★")
    CheckStr=Str
End Function
'转换HTML代码-----------------------
Function HTMLDecode(reString)
    Dim Str:Str=reString
    If Not IsNull(Str) Then
        Str = Replace(Str, "&amp;", "&")
        Str = Replace(Str, "&gt;", ">")
        Str = Replace(Str, "&lt;", "<")
        Str = Replace(Str, "&nbsp;", CHR(32))
        Str = Replace(Str, "&nbsp;", CHR(9))
        Str = Replace(Str, "    ", CHR(9))
        Str = Replace(Str, "&quot;", CHR(34))
        Str = Replace(Str, "'", CHR(39))
        Str = Replace(Str, "", CHR(13))
        Str = Replace(Str, "<br>", CHR(10))
        HTMLDecode = Str
    End If
End Function


'--------SQL防注入定义部份------------------
Dim Fy_Post,Fy_Get,Fy_In,Fy_Inf,Fy_Xh
Fy_In = "or|三维画|钢|板|天津|管|枪|★|◣|◢|法轮功|法轮功|贷款|迷药|迷昏药|窃听器|六合彩|买卖枪支|三唑仑|麻醉药|麻醉乙醚|短信群发器|催情药|春药|窃听器|出售手枪|办理证件|办证|办理文凭|骗子|join|union|like|modify|cast|drop|exec|insert|select|delete|update|count|alter|rename|chr|mid|truncate|char|declare|'"
Fy_Inf = split(Fy_In,"|")
'--------POST部份------------------
If Request.Form<>"" Then
For Each Fy_Post In Request.Form
For Fy_Xh=0 To Ubound(Fy_Inf)
If Instr(LCase(Request.Form(Fy_Post)),Fy_Inf(Fy_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert('林城分类信息网提示您↓\n\n您的本此操作含有不被允许的字符失败了!');history.back();</Script>"
Response.End
End If
Next
Next
End If
'--------GET部份-------------------
If Request.QueryString<>"" Then
For Each Fy_Get In Request.QueryString
For Fy_Xh=0 To Ubound(Fy_Inf)
If Instr(LCase(Request.QueryString(Fy_Get)),Fy_Inf(Fy_Xh))<>0 Then
Response.Write "<Script Language=JavaScript>alert('林城分类信息网提示您↓\n\n您的本此操作失败了!');history.back();</Script>"
Response.End
End If
Next
Next
End If
'----------------------------------
'数据库连接文件
dim conn,connstr,db,startime
startime=timer()
'db="
db="alldata/#ak9826.mdb"

Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
'connstr="driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath(db)
conn.Open connstr
sub closedb()
conn.close
set rs=nothing
set conn=nothing
end sub
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "<script Language=javascript>location.href = '我休息会,马上就好,请稍后访问!';</script>"
Response.End
End If
%>
搜索更多相关主题的帖子: 注册 
2008-11-21 14:46
快速回复:注册提交时因为SQL防注入过滤导致无法注册,怎么处理?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.037821 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved