asp判断数字是否整形怎么判断数字是否
"9" or mid(str,i,1)0 then err。clear
end function
%>
防止注入楼主可以加在全站防注入的代码,在网上搜索一下。。
试试
id=request("id")
if not IsNumeric(id) or isEmpty(id) then
response。 Write "从请正确的路径访问"
response。end()
end if
以下是防注入代码,你保存一下,然后加在asp页面中。。
"" Then
For Each Fy_Post In Request。 Form
For Fy_Xh=0 To Ubound(Fy_Inf)
If I...全部
"9" or mid(str,i,1)0 then err。clear
end function
%>
防止注入楼主可以加在全站防注入的代码,在网上搜索一下。。
试试
id=request("id")
if not IsNumeric(id) or isEmpty(id) then
response。
Write "从请正确的路径访问"
response。end()
end if
以下是防注入代码,你保存一下,然后加在asp页面中。。
"" 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 "alert('请不要在参数中包含非法字符尝试注入!');location。href='。。/index。asp';"
'Response。Write "非法操作!系统做了如下记录"
'Response。
Write "操作IP:"&Request。ServerVariables("REMOTE_ADDR")&""
'Response。Write "操作时间:"&Now&""
'Response。
Write "操作页面:"&Request。ServerVariables("URL")&""
'Response。Write "提交方式:POST"
'Response。Write "提交参数:"&Fy_Post&""
'Response。
Write "提交数据:"&Request。Form(Fy_Post)
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 "alert('请不要在参数中包含非法字符尝试注入!');location。href='。。/index。asp';"
'Response。Write "非法操作!系统做了如下记录"
'Response。
Write "操作IP:"&Request。ServerVariables("REMOTE_ADDR")&""
'Response。Write "操作时间:"&Now&""
'Response。
Write "操作页面:"&Request。ServerVariables("URL")&""
'Response。Write "提交方式:GET"
'Response。Write "提交参数:"&Fy_Get&""
'Response。
Write "提交数据:"&Request。QueryString(Fy_Get)
Response。End
End If
Next
Next
End If
%>。收起