<% if request("keywords")<>"" then if checktxt(request("keywords"))<>request("keywords") then response.write "" response.end end if end if %> <% Response.Buffer=True DB="db/xybook.asp" '数据库路径和文件名,请修改引号中的文件名 on error resume next '这一句很关键,不能删除 set conn=server.createobject("adodb.Connection") connstr="provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(DB) conn.Open connstr set book=conn.execute("select * from book_setup") sitename=book("sitename") admin=book("admin") password=book("password") maxlength=cint(book("maxlength")) view=book("view") pages=cint(book("pages")) html=cint(book("html")) mailyes=cint(book("mailyes")) book_jianju=cint(book("book_jianju")) huifutishi=cstr(book("huifutishi")) huifucolor=cstr(book("huifucolor")) bad=cstr(book("bad")) set book=nothing '检查用户输入的内容中是否含有非法字符 function checktxt(txt) chrtxt="33|34|35|36|37|38|39|40|41|42|43|44|47|58|59|60|61|62|63|91|92|93|94|96|123|124|125|126|128" chrtext=split(chrtxt,"|") for c=0 to ubound(chrtext) txt=replace(txt,chr(chrtext(c)),"") next checktxt=txt end function '################################################################# '# 程序名称:逍遥留言本 V1.0 '# 授权方式:免费软件 '# 作者:逍遥浪子 '# 演示及技术支持:http://www.xybook.com '# 发布时间:2005-4-8 '# 声明:本程序由逍遥浪子独立自主开发,保留所有版权。 '# 各种用途均可免费使用、自由传播,但必须保留程序代码中的版权信息。 '################################################################# %> 豪辉机械-东莞豪辉精密机械有限公司
    
<% set rs=Server.CreateObject("ADODB.RecordSet") sql="select * from Feedback where online='1' " keywords=request("keywords") if keywords<>"" then sql=sql+ " and Comments like '%"&keywords&"%' " sql=sql + "order by top desc,Postdate desc" rs.open sql,conn,1 if not (rs.eof and rs.bof) then '如果有留言时,就显示留言。此行的if与倒数第6行的end if相对应 if pages=0 or pages="" then pages=10 '每页留言条数 rs.pageSize = pages '每页记录数 allPages = rs.pageCount '总页数 page = Request("page") '从浏览器取得当前页 'if是基本的出错处理 If not isNumeric(page) then page=1 if isEmpty(page) or Cint(page) < 1 then page = 1 elseif Cint(page) >= allPages then page = allPages end if rs.AbsolutePage = page '转到某页头部 Do While Not rs.eof and pages>0 UserName=rs("UserName") '用户名 pic=rs("pic") '头像 face=rs("face") '表情 Comments=rs("Comments") '内容 bad1=split(bad,"/") '过滤脏话 for t=0 to ubound(bad1) Comments=replace(Comments,bad1(t),"***") next Replay=rs("Replay") '回复 Usermail=rs("Usermail") '邮件 url=rs("url") '主页 I=I+1 '序号 temp=RS.RecordCount-(page-1)*rs.pageSize-I+1 %>
 
姓名:<%=UserName%>
来自:<%=left(rs("ip"),(len(rs("ip"))-2))+"**"%>
邮件:><%=Usermail%>
主页:<%=URL%>
<%if rs("top")<>"1" then response.write "[NO."&temp&"]"%> 发表于:<%=cstr(rs("Postdate"))%>
<% '是否屏蔽留言内容中的html字符 if html=0 then response.write replace(server.htmlencode(Comments),vbCRLF,"
") else response.write replace(Comments,vbCRLF,"
") end if %>

<%if rs("Replay")<>"" then%>
><%=huifutishi%>:
<%=Replay%>

<%end if%>
<% pages = pages - 1 rs.movenext if rs.eof then exit do loop response.write "
总计留言"&RS.RecordCount&"条 " if page = 1 then response.write "首页 前页" else response.write "首页 前页" end if if page = allpages then response.write " 下页 末页" else response.write " 下页 末页" end if response.write " 第"&page&"页 共"&allpages&"页   转到第 " response.write "
" response.write "
" else response.write "
" if keywords="" then response.write "暂时没有留言" else response.write "抱歉,没有找到您要查到的内容

返回上一页" end if response.write "
" end if %>
   
 
 
 首页 豪輝精密機械有限公司版權所有 廠址:東莞市厚街鎮涌口管理區南社泗洲中橋 電話:(+86)0769-85888926 85888936 傳真:(+86)0769-85088468
高速冲床|高速精密冲床|高速精密自动冲床|龙门高速冲床|龙门精密高速自动冲床|龙门式高速冲床|豪辉机械|三圆导柱高速精密自动冲床 技术支持:中佳网营