/lyaddcl.asp代码页
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><?xml version="1.0" encoding="utf-8"?>
<%response.buffer=true%>
<%Response.ContentType = "text/vnd.wap.wml; charset=utf-8"%>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml"><%
'====================================================================
' 请你保留这段说明,这并不会影响你的速度.   电脑交流:http://www.cnscu.cn
' 程序制作:横云			  掌上校园收倾心整理收集于互联网,感谢你的支持!
' 升级时间: 2008-2-5  		主页地址:HTTP://wap.cnscu.cn
' E-Mail: cnscu@126.com   	客服QQ:554904632 QQ群:30493504 QQ群2:46659883
'====================================================================
%> <%
''''''''''''''''''''''''
'ASP通用防注入代码 
'您可以把该代码COPY到头文件中.也可以单独作
'为一个文件存在,每次调用使用 
'作者:y3gu - 2005-7-29 
'''''''''''''''''''''''''''''''''
Dim GetFlag Rem(提交方式)
Dim ErrorSql Rem(非法字符) 
Dim RequestKey Rem(提交数据)
Dim ForI Rem(循环标记)
ErrorSql = "'~;~and~or~exec~update~count~chr~mid~master~你老~我插~他妈的~操~你妈~操你妈~你妈B~干你母~骗子~狗日~狗日的~去死~王八蛋~全家死~你女马B~女马女马~女马~你老母~你奶奶的~狐狸~去死~傻逼~truncate~char~declare" Rem(每个敏感字符或者词语请使用半角 "~" 格开)
ErrorSql = split(ErrorSql,"~")
If Request.ServerVariables("REQUEST_METHOD")="GET" Then
GetFlag=True
Else
GetFlag=False
End If
If GetFlag Then
For Each RequestKey In Request.QueryString
For ForI=0 To Ubound(ErrorSql)
If Instr(LCase(Request.QueryString(RequestKey)),ErrorSql(ForI))<>0 Then
response.write "<wml><card title='对不起'><p>你的输入含有非法字符,请<anchor>返回<prev/></anchor>重新填写!<br/>管理条例<br/>请不要直接问候别人亲人<br/>请不要恶意中伤<br/>请不要尝试注入<br/>请不要设想与别人女性亲属发生不正当关系<br/>请不要描写女性器官<br/>等等````</p></card></wml>"
Response.End
End If
Next
Next 
Else
For Each RequestKey In Request.Form
For ForI=0 To Ubound(ErrorSql)
If Instr(LCase(Request.Form(RequestKey)),ErrorSql(ForI))<>0 Then
response.write "<wml><card title='对不起'><p>你的输入含有非法字符,请<anchor>返回<prev/></anchor>重新填写!<br/>管理条例<br/>请不要直接问候别人亲人<br/>请不要恶意中伤<br/>请不要尝试注入<br/>请不要设想与别人女性亲属发生不正当关系<br/>请不要描写女性器官<br/>等等```<br/></p></card></wml>"
Response.End
End If
Next
Next
End If
%>
<!--#include file="conn.inc"-->
<%
name=request("name")
title=request("title")
text=request("text")
lianxi=request("lianxi")
open=request("open")
pic=request("pic")
num=request("num")
agent=request.serverVariables("HTTP_USER_AGENT")

if name="" then response.redirect "lyadd.asp?myid=" & myid & ""
if title="" then response.redirect "lyadd.asp?myid=" & myid & ""
if text="" then response.redirect "lyadd.asp?myid=" & myid & ""
if num="" and open=1 then response.redirect "lyadd.asp?myid=" & myid & ""
kword=split("fuck,他妈的,我靠,我操,去死,我叼,烂逼,骗钱,你妈B,狗日的,去死,骗子,我日,TMD,TND,你妈的",",")
function keyWord(s)
dim KwCount
KwCount=0
	for kwi=0 to ubound(kword)
		KwCount = KwCount + instr(s,kword(kwi))
	next
	keyWord=KwCount
end function
if keyWord(con)>0 then response.redirect "lyadd.asp"

set rs=Server.CreateObject("ADODB.Recordset")
rsstr="select * from [gbook] where [num]='" & num & "' order by ID desc"
rs.open rsstr,conn,1,2

dim errr
errr=0
if rs.recordcount>0 then
	if rs("name")=name and rs("title")=title and rs("text")=text then errr=1
end if

if errr=1 then eer="请不要重复留言,<br/>正在返回留言黑板!<br/>"
if errr<>1 then

rs.addnew
if name<>"" then rs("name")=name
if title<>"" then rs("title")=title
if text<>"" then rs("text")=text
if lianxi<>"" then rs("lianxi")=lianxi
rs("open")=open
rs("pic")=pic
if num<>"" then rs("num")=num
rs("agent")=agent
rs.update

end if


if rs.recordcount=0 then
rs.addnew
if name<>"" then rs("name")=name
if title<>"" then rs("title")=title
if text<>"" then rs("text")=text
if lianxi<>"" then rs("lianxi")=lianxi
rs("open")=open
rs("pic")=pic
if num<>"" then rs("num")=num
rs("agent")=agent
rs.update
end if

rs.close
set rs=Nothing
conn.close
set conn=nothing
%>
<wml>
<head>
<meta http-equiv="Cache-Control" content="no-Cache"/>
<meta http-equiv="Cache-Control" content="max-age=0"/>
</head>
<card title="发表留言" ontimer="ly.asp">
<timer value="10"/>
<p>
<%if eer="" then%>
发表成功,<br/>
正在返回留言首页!<br/>
<%else%>
<%=eer%>
<%end if%>
----------<br/>
<a href="ly.asp">留言首页</a><br/>
<a href="index.asp">网站主页</a>

</p>
</card>
</wml>
字母检索
回到顶部