%
MQ_NoSqlHack_AllStr="'| and |:declare|chr(|exec |insert |select |script |delete from|update |mid(|master."
MQ_NoSqlHack_ComeUrlGet = Request.QueryString
MQ_NoSqlHack_ComeUrlPost = Request.Form
MQ_NoSqlHack_Str = Split(MQ_NoSqlHack_AllStr,"|")
'Post
If MQ_NoSqlHack_ComeUrlPost<>"" then
For Each MQ_NoSqlHack_Post In Request.Form
For MQ_NoSqlHack_i = 0 To Ubound(MQ_NoSqlHack_Str)
If Instr(LCase(Request.Form(MQ_NoSqlHack_Post)),MQ_NoSqlHack_Str(MQ_NoSqlHack_i))<>0 Then
Response.Write("")
Response.End
End if
Next
Next
End if
'Get
If MQ_NoSqlHack_ComeUrlGet<>"" then
For Each MQ_NoSqlHack_Get In Request.QueryString
For MQ_NoSqlHack_i = 0 To Ubound(MQ_NoSqlHack_Str)
If Instr(LCase(Request.QueryString(MQ_NoSqlHack_Get)),MQ_NoSqlHack_Str(MQ_NoSqlHack_i))<>0 Then
Response.Write("")
Response.End
End if
Next
Next
End if
%>
<%
set conn=server.createobject("adodb.connection")
'conn.open "driver={SQL Server};server=(local);database=51dh;"
conn.open "Provider=SQLOLEDB;Integrated Security=SSPI;server=(local);database=51dh;"
%>
<%
'以下为判断链接来源
If Request.ServerVariables("HTTP_REFERER")<>"" Then
tmpstr=Request.ServerVariables("HTTP_REFERER")
Comeurl=trim(tmpstr)
Comeurl = Left(Comeurl, InStr(InStr(Comeurl, "//") + 2, Comeurl, "/"))
comeurl=replace(comeurl,"//","\\")
comeurl=replace(comeurl,"/","")
comeurl=replace(comeurl,"\\","//")
conn.execute("update [51dh].dbo.search set friendshow=1,showndate=getdate() where url like '"&comeurl&"' or url like '"&comeurl&"/'")
'set rs=conn.execute("update [51dh].dbo.search set friendshow=1,showndate=getdate() where url like '"&comeurl&"/'")
'response.write "update [51dh].dbo.search set friendshow=1,showndate=getdate() where '%url%' like '"&comeurl&"'"
Else
Comeurl="index.htm"
End If%>
<%
'得到当前页面的地址
dim refurl
Function GetUrl()
On Error Resume Next
Dim strTemp
If LCase(Request.ServerVariables("HTTPS")) = "off" Then
strTemp = "http://"
Else
strTemp = "https://"
End If
strTemp = strTemp & Request.ServerVariables("SERVER_NAME")
If Request.ServerVariables("SERVER_PORT") <> 80 Then strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT")
strTemp = strTemp & Request.ServerVariables("URL")
If Trim(Request.QueryString) <> "" Then strTemp = strTemp & "?" & Trim(Request.QueryString)
GetUrl = strTemp
End Function
refurl=geturl()
if refurl<>"" and instr(refurl,"ibookdown.com")>0 then response.redirect "http://www.51dh.net/book"
%>