<%@ Language=VBScript %> <% response.buffer=true Response.Expires=0 usercookies=Request.Cookies("usercookies") if not session("password")<>"" then if usercookies > "0" then name=Request.Cookies("username") password=Request.Cookies("password") sql="select * from admin where id=1" set rs8=conn.execute(sql) if not(rs8.bof and rs8.eof) then if password=rs8("userpass") and name=rs8("username") then session("user")=name session("password")="wpassword" end if end if end if end if Set rs9 = Server.CreateObject("ADODB.Recordset") sql9 ="SELECT * From about Order By id DESC" RS9.open sql9,Conn,3,3 mypagesize=cint(rs9("num")) '每页显示留言数 badnicks=rs9("badnicks") badwords=rs9("badwords") Set rs = Server.CreateObject("ADODB.Recordset") sql = "Select * FROM guestbook Order By dateandtime Desc" rs.open sql,conn,1,1 IF not IsNumeric(Request("page")) Or IsEmpty(Request("page")) Then page=1 Else Page=Int(Abs(Request("page"))) End if rs.pagesize = mypagesize total = rs.RecordCount rs.absolutepage = page if request("test")="insert" then '防止垃圾留言功能开始 dim ComeUrl,cUrl ComeUrl=lcase(trim(request.ServerVariables("HTTP_REFERER"))) if ComeUrl="" then MessageBox "错误信息:对不起,为了系统安全,不允许直接输入地址访问本页面。" response.end else cUrl=trim("http://" & Request.ServerVariables("SERVER_NAME")) if mid(ComeUrl,len(cUrl)+1,1)=":" then cUrl=cUrl & ":" & Request.ServerVariables("SERVER_PORT") end if cUrl=lcase(cUrl & request.ServerVariables("SCRIPT_NAME")) if lcase(left(ComeUrl,instrrev(ComeUrl,"/")))<>lcase(left(cUrl,instrrev(cUrl,"/"))) then MessageBox "错误信息:留言本防垃圾留言功能已经打开,禁止从外部链接地址提交留言。" response.end end if end if '防止垃圾留言功能结束 txtname=left(request("txtname"),30) txtemail=left(request("txtemail"),30) txthomepage=left(request("txthomepage"),50) txtoicq=left(request("txtoicq"),10) if request.form("xxx")="" then pic="images/1.gif" else pic=request.form("xxx") end if txtcome=left(request("txtcome"),20) sex=request("sex") txtcontent=left(request("txtcontent"),500) '设置灌水限制 posttime=60 if cint(posttime)<>0 then if not isnull(session("posttime")) or cint(posttime)>0 then if DateDiff("s",session("posttime"),Now())"" and IsValidEmail(txtemail)=false then MessageBox "错误信息:邮件地址填写出错:请确认你的邮件地址。" response.end end if if txtname="" then MessageBox "别椤着,输入内容啊~~~" response.end end if if txtcontent="" then MessageBox "错误信息:请填入你的名字!" response.end end if if txtemail="" then txtemail="不告诉你!" if txtoicq="" then txtoicq="打死我也不说!" if txtcome="" then txtcome="保密!" if txthomepage="" or txthomepage="http://" then txthomepage="还没有呢!" function MessageBox(strOutput) response.write "" & VbCRLF response.end end function function IsValidEmail(email) dim names, name, i, c IsValidEmail = true names = Split(email, "@") if UBound(names) <> 1 then IsValidEmail = false exit function end if for each name in names if Len(name) <= 0 then IsValidEmail = false exit function end if for i = 1 to Len(name) c = Lcase(Mid(name, i, 1)) if InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 and not IsNumeric(c) then IsValidEmail = false exit function end if next if Left(name, 1) = "." or Right(name, 1) = "." then IsValidEmail = false exit function end if next if InStr(names(1), ".") <= 0 then IsValidEmail = false exit function end if i = Len(names(1)) - InStrRev(names(1), ".") if i <> 2 and i <> 3 then IsValidEmail = false exit function end if if InStr(email, "..") > 0 then IsValidEmail = false end if end function function IsLongStr(str) dim longStrs,longstr IsLongStr = true longStrs = Split(str,"") for each longStr in longStrs if len(longstr) > 50 then ISlongStr = false end if next end function txtname=server.htmlencode(txtname) txtcome=server.htmlencode(txtcome) txtemail=server.htmlencode(txtemail) txtcome=server.htmlencode(txtcome) txthomepage=txthomepage txtoicq=server.htmlencode(txtoicq) txtcontent=server.htmlencode(txtcontent) reply = "没有" '使用屏蔽昵称 check_name=txtname badnicks=split(badnicks,",") for i = 0 to ubound(badnicks) if instr(check_name,badnicks(i))>0 then MessageBox "错误信息:您使用了屏蔽的昵称。" response.end exit for end if next '使用屏蔽字符 check_content=txtcontent badwords=split(badwords,",") for i = 0 to ubound(badwords) if instr(check_content,badwords(i))>0 then MessageBox "错误信息:您使用了非法的留言内容。" response.end exit for end if next Set rs= Server.CreateObject("ADODB.Recordset") sql="select * from guestbook" rs.open sql,conn,3,2 rs.addnew rs("name")=txtname rs("email")=txtemail rs("homepage")=txthomepage rs("come")=txtcome rs("oicq")=txtoicq rs("content")=txtcontent rs("head")=pic rs("dateandtime")=now() rs("reply")=reply rs("ip")=Request.ServerVariables("REMOTE_HOST") rs("sex")=cint(sex) rs.update rs.close if cint(posttime)<>0 then session("posttime")=now() end if response.redirect "index.asp" end if %> <%=rs9("name")%> ,留言簿"> 的留言簿">
 
[ 网站首页 ] [ 查看留言 ] [ 管理登录 ] [ 注销退出 ]

 

" width=100%> <% dim i i=1 do while not rs.eof and mypagesize>0 id=rs("gbookid") name=rs("name") email=rs("email") homepage=rs("homepage") oicq=rs("oicq") head=rs("head") content=rs("content") content=Autolink(content) dateandtime=rs("dateandtime") reply=rs("reply") reply=addlink(reply) sex=rs("sex") %> <% mypagesize=mypagesize-1 i=i+1 rs.movenext loop %>
" rowspan=2 width=80>
<% if rs9("textonly")=0 then %>
<% end if %>
<%=name%>
" height=20>
 发表于:<%=dateandtime%> <%=name%来自<%=rs("come")%> border=0 height=16 src="images/icon_profile.gif" width=16> "!" then %> href="mailto:<%=email%>" <% end if %> title="<%=name%>的邮件地址是:<%=email%>"> "!" then %> href="<%=homepage%>" <% end if %> target=_blank title="<%=name%>的主页地址是:<%=homepage%>"> <%=name%的IP地址是:<%=rs("ip")%> height=16 src="images/icon_ip.gif" width=16> <% if session("password")="wpassword" then %> <% end if %>
" height=80>
<%=content%>
<%if reply<>"没有" then%>

版主回复:<%=reply%> <%end if%>
" colspan=2 height=18 valign=bottom>
<%=rs.pagecount%><%=total%>条留言 当前第<%=page%>首页 <%if page>1 then%> class="black">上一页 <%else%> 上一页 <%end if%> <%if page class="black">下一页 <%else%> 下一页 <%end if%> class="black">尾页
<%for i=1 to rs.pagecount if i=page then response.write "["+Cstr(i)+"] " else response.write "["+""+Cstr(i)+"] " end if next%>
姓名
Email
主页
oicq
来自
<% if rs9("textonly")=0 then %> 个人形象代表 头像 <% end if %>

电话:010-60249337

传真:010-60249337 手机:13366976296

地址:北京市大兴工业开发区

  网址:http://lyqc.com.cn

  信箱:huojia163@126.com

  产品:货架 仓储货架 精品货架