⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 book.asp

📁 主要功能是为大家提供一个免费的校园平台网站,有新闻发布、会员及管理、论坛
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="mdb.asp"-->
<!--#include file="inc/inc.asp"-->
<!--#include file="inc/config.asp"-->
<%
start="留言本"
Ly_Inf = split(Ly_In,"|")
If Request.Form<>"" Then
	For Each Ly_Post In Request.Form
		For Ly_Xh=0 To Ubound(Ly_Inf)
			If Instr(LCase(Request.Form(Ly_Post)),Ly_Inf(Ly_Xh))<>0 Then
				Response.Write "<Script Language=JavaScript>alert('对不起,你发表的内容中包含系统禁止字符!');javascript :history.back();</Script>"
				Response.End
			End If
		Next
	Next
End If
dim founderr
founderr=false
if request("page")<>"" then
  if not isInteger(request("page")) then
    founderr=true
    Response.Write "<script language=javascript>alert('参数非法。');javascript:history.back();</script>"
  end if
end if
if request("keyword")<>"" then
  if instr(request("keyword"),"'")>0 then
    founderr=true
    Response.Write "<script language=javascript>alert('搜索参数非法');javascript:history.back();</script>"
  end if
end if
page = Request("page")
action = Request.QueryString("action")
action_e = Request.Form("action_e")
call head
call menu
Response.Write "<TABLE id=navsub cellSpacing=0 cellPadding=0 align=center><TBODY><TR><TD class=l></TD><TD height=""23"" align=""right"">"
call Main_Menu()
Response.Write "&nbsp;</TD><TD class=r></TD></TR></TBODY></TABLE>" & vbCrLf
Response.Write "<TABLE id=middle cellSpacing=0 cellPadding=0 align=center boder=""0"" height=300>" & vbCrLf
Response.Write "  <TBODY>" & vbCrLf
Response.Write "  <TR vAlign=top align=left>" & vbCrLf
Response.Write "    <TD width=200>" & vbCrLf
Response.Write "<DIV class=member>" & vbCrLf
Response.Write "<SCRIPT type=text/javascript>lanyutabletop(""留 言 说 明"",""ml"");</SCRIPT>" & vbCrLf
Response.Write "<div style=""LINE-HEIGHT: 180%"">" & vbCrLf
Response.Write "·尊重网上道德,遵守中华人民共和国的各项有关法律法规" & vbCrLf
Response.Write "<br>·承担一切因您的行为而直接或间接导致的民事或刑事法律责任" & vbCrLf
Response.Write "<br>·本站管理人员有权保留或删除其管辖留言中的任意内容" & vbCrLf
Response.Write "<br>·本站有权在网站内转载或引用您的留言" & vbCrLf
Response.Write "<br>·参与本留言即表明您已经阅读并接受上述条款" & vbCrLf	
Response.Write "</div>" & vbCrLf
Response.Write "<SCRIPT type=text/javascript>lanyutablebottom(""mr"");</SCRIPT>" & vbCrLf
Response.Write "<SCRIPT type=text/javascript>lanyutabletop(""留 言 查 找"",""ml"");</SCRIPT>" & vbCrLf
Response.Write "<form name=""form2"" method=""post"" action=""book.asp""><div align=center><input type=""radio"" name=""select"" value=""name"" checked>作者&nbsp;<input type=""radio"" name=""select"" value=""words"">内容&nbsp;<input type=""radio"" name=""select"" value=""reply"">回复<br><input type='text' name='keyword'  size='15' value='搜索关键字' maxlength='50' onFocus='this.select();' class=""lanyu"">&nbsp;<input type='submit' name='search'  value='搜索' onmouseover=""this.className='boton'"" onmouseout=""this.className='botoff'"" class=""botoff"">" & vbCrLf
Response.Write "</div></form>" & vbCrLf
Response.Write "<SCRIPT type=text/javascript>lanyutablebottom(""mr"");</SCRIPT>"
Response.Write "</TD>" & vbCrLf
Response.Write "<TD>" & vbCrLf
Response.Write "<DIV class=mframe>" & vbCrLf
%><SCRIPT type=text/javascript>lanyutable("<%if request("keyword")<>"" then%>搜索结果<%else%>留言本<%end if%>");</SCRIPT><%
Response.Write "<table width=""100%"" border=""1"" align=""center"" cellspacing=""0"" cellpadding=""3"" bgcolor=""#FFFFFF"" bordercolor=""#f0f0f0"" style=""border-collapse: collapse"" frame=lhs>"
Select Case action_e
	Case ""
	Case "Add_New"
if int(request("VerifyCode"))<>int(Session("GetCode")) then
 Response.Write("<script language=javascript>alert('请输入正确的认证码!');window.document.location.href='book.asp?action=Add_New';</script>") 
Response.End 
end if 
Call Add_New_Execute()
	Case "Edit"
if session("adminlogin")<>sessionvar then
Response.write "<script language = 'javascript'>alert('您还未登陆管理,无法进行编辑留言!');window.document.location.href='book.asp';</script>"
else
		Call Edit_Execute()
end if

End Select

Select Case action		
	Case ""		
		Call View_Words()		
	Case "Add_New"
		Call Add_New()
	Case "Edit"
		Call Edit()
	Case "View_Words"	
		Call View_Words()	
	Case "Delete"
if session("adminlogin")<>sessionvar then
Response.write "<script language = 'javascript'>alert('您还未登陆管理,无法删除留言!');window.document.location.href='book.asp';</script>"
else
		Call Delete()
		Call View_Words()
end if				
End Select
Call footer()
Sub Main_Menu()
Response.Write "<a href='?action=Add_New'>·添加留言</a>&nbsp;<a href='?action=View_Words'>·查看留言</a>&nbsp;"
End Sub 
Sub View_Words() 
		Set Rs = Server.CreateObject("ADODB.RecordSet")
		Sql="Select * From words Order By date Desc"
                if request("keyword")<>"" then
                sql="select * from words where "&request("select")&" like '%"&request("keyword")&"%'order by date DESC"
                 end if
		Rs.Open Sql,Conn,1,1
		TotalRecord=Rs.RecordCount
if not rs.eof then
		Rs.PageSize = 10
		PageSize = Rs.PageSize
		PageCount=Rs.PageCount
                if page="" Then  
			Page = 1
		Else
			Rs.AbsolutePage = page
		End If
i=0
    do while i < PageSize And not rs.eof 
NO=TotalRecord-i-(PageSize*Page)+PageSize
%><tr bgcolor="#ffffff"><td colspan="2" height="10"></td></tr><tr bgcolor="#ffffff"><td rowspan=2 width=90 align="center" valign="top"><%If Rs("qq")<>"" Then%><a target="_blank" href="http://qqshow.qq.com/cgi-bin/qqshow_user_info?uin=<%=Rs("qq")%>"><img width="70" height="113" border="0" src="http://qqshow-user.tencent.com/<%=Rs("qq")%>/11/00/"></a><%else%><img src=img/<%=Rs("sex")%>.gif><%End If%><br><a href="book.asp?select=name&keyword=<%=Rs("name")%>" title='查找[<%=Rs("name")%>]发表的所有留言'><font class="book"><%=Rs("name")%></font></a></td><td height=20><table border=0 cellpadding=0 cellspacing=0 width="100%"><tbody><tr><td valign=bottom width="40%"><%=NO%>楼·<%=Rs("date")%></td><td align=right width="60%"><%If Rs("city")<>"" Then%><img align=absBottom title="<%=Rs("name")%>来自<%=Rs("city")%>" border=0 height=16 src="img/book_city.gif" width=16>&nbsp;<%End If%><%If Rs("email")<>"" Then%><a href="mailto:<%=Rs("email")%>"><img align=absBottom border=0 height=16 src="img/book_email.gif" width=16 title="给<%=Rs("name")%>写信"></a>&nbsp;<%End If%><%If Rs("qq")<>"" Then%><img align=absBottom title="<%=Rs("name")%>的QQ号码是<%=Rs("qq")%>" border=0 height=16 src="img/book_qq.gif" width=16>&nbsp;<%End If%><%If Rs("uc")<>"" Then%><img align=absBottom title="<%=Rs("name")%>的uc号码是<%=Rs("uc")%>" border=0 height=16 src="img/book_qq.gif" width=16>&nbsp;<%End If%><%If Rs("web")<>"" Then%><a href="<%=Rs("web")%>" target="_blank"><img align=absBottom border=0 height=16 src="img/book_web.gif" width=16 title="去<%=Rs("name")%>的主页看看"></a>&nbsp;<%End If%><img align=absBottom title="<%=Rs("name")%>的IP地址为<%=Rs("ip")%>" height=16 src="img/book_ip.gif" width=16>&nbsp;<% If session("adminlogin")=sessionvar Then %><a href="book.asp?action=Delete&id=<%=Rs("id")%>"><img align=absBottom border=0 title="【删除】" height=16 src="img/book_Delete.gif" width=16></a>&nbsp;<a href="book.asp?action=Edit&id=<%=Rs("id")%>"><img align=absBottom border=0 title="【编辑回复】" height=16 src="img/book_edit.gif" width=16></a>&nbsp;<%End if%></td></tr></tbody></table></td></tr><tr><td bgcolor="#ffffff" height=80><table border=0 cellpadding=0 cellspacing=2 width=100% height=100% style='table-layout:fixed; word-break:break-all; line-height:150%'><tbody><tr><td><%If Rs("admin")="0" Then%>[<%if Rs("title")="1" then%><font color=#0000FF>留言</font><%elseif Rs("title")="2" then%><font color=#FF00FF>建议</font><%elseif Rs("title")="3" then%><font color=#FF7F50>报错</font><%elseif Rs("title")="4" then%><font color=#228B22>连接</font><%elseif Rs("title")="5" then%><font color=#1E90FF>其它</font><%End If%>]<%=Ubb(unHtml(Rs("words")))%><%elseif session("adminlogin")=sessionvar Then %><center><font color=#1E90FF>─────≡ 以下为管理员可见内容 ≡─────</font></center>[<%if Rs("title")="1" then%><font color=#0000FF>留言</font><%elseif Rs("title")="2" then%><font color=#FF00FF>建议</font><%elseif Rs("title")="3" then%><font color=#FF7F50>报错</font><%elseif Rs("title")="4" then%><font color=#228B22>连接</font><%elseif Rs("title")="5" then%><font color=#1E90FF>其它</font><%End If%>]<%=Ubb(unHtml(Rs("words")))%><%else%><center><font color=#1E90FF>─────≡ 秘密留言!管理员可见 ≡─────</font></center><%End If%></td></tr><%If Rs("reply")<>"" Then%><tr><td valign="bottom"><div style="margin:0px 3px;border:1px solid #CCCCCC;padding:5px;background:#FDFDDF ;line-height:150%;" ><font color=#ccccccc><b><%=webceo%>回复于:</b><%=Rs("redate")%></font><br><%=Ubb(unHtml(Rs("reply")))%></div></td></tr><%End If%></table></td></tr><%
		 
		rs.movenext
		i=i+1
    	loop
else
if rs.eof and rs.bof then
%>
<tr><td align=middle height="80" colSpan=2><%if request("keyword")<>"" then%>没有找到包含[<b><font color=red><%=request("keyword")%></font></b>]的留言!<%else%>没有任何留言,欢迎您成为本站第一个留言者!<%end if%></td></tr>
<%Response.Write "<tr align=""center""><td bgcolor=""#F0f0f0"" height=""1"" colspan=""2""></td></tr></TABLE></td></tr></TABLE>"
end if
end if
		Rs.Close
		Set Rs = Nothing
dim n
n= TotalRecord \ PageSize
Response.Write "<tr bgcolor=""#ffffff""><td colspan=""2"" height=""10""></td></tr>" & vbCrLf
Response.Write "<TR bgColor=#FFFFFF><TD colspan=""2"">" & vbCrLf
Response.Write "<TABLE width=""100%"" align=center border=0>" & vbCrLf
Response.Write "<TBODY>" & vbCrLf
Response.Write "<TR>" & vbCrLf
Response.Write "<TD align=middle width=""35%"" height=25><IMG height=14 src=""img/so.gif"" width=14 align=absMiddle> 共[<font color=""#FF6666"">"&TotalRecord&"</font>]个留言 分" & vbCrLf
Response.Write "" & vbCrLf
Response.Write "[<font color=""#FF6666"">"&n+1&"</font>]页</TD>" & vbCrLf
Response.Write "<TD width=""40%"" align=middle><IMG height=11 src=""img/lt.gif"" width=11 align=absMiddle>"
if Page<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href=book.asp?select="&request("select")&"&keyword="&request("keyword")&">首页</a> "
response.write "<a href=book.asp?select="&request("select")&"&keyword="&request("keyword")&"&page="&Page-1&">上一页</a> "
end if
if n-page<0 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href=book.asp?select="&request("select")&"&keyword="&request("keyword")&"&page="&(Page+1)
response.write ">下一页</a> <a href=book.asp?select="&request("select")&"&keyword="&request("keyword")&"&page="&n+1&">尾页</a>"
end if
Response.Write "<IMG height=11 src=""img/rt.gif"" width=11 align=absMiddle></TD>" & vbCrLf
Response.Write "<form name=""form1"" method=""post"" action=""book.asp?select="&request("select")&"&keyword="&request("keyword")&"""><TD align=middle width=""25%"">" & vbCrLf
Response.Write "<select name=""page"" class=""lanyu"">"
For p = 1 To PageCount
if request("page")=cstr(p) then
%>
<option value=<%=p%> selected>第<%=p%>页</option> 
<%else%>
<option value=<%=p%>>第<%=p%>页</option> 
<%end if
Next
Response.Write "</select><input type=""submit"" name=""Submit2"" value=""转向"" onmouseover=""this.className='boton'"" onmouseout=""this.className='botoff'"" class=""botoff""></TD></FORM>" & vbCrLf
Response.Write "</TR>" & vbCrLf
Response.Write "</TABLE>" & vbCrLf
Response.Write "<tr align=""center""><td bgcolor=""#F0f0f0"" height=""1"" colspan=""2""></td></tr>" & vbCrLf
Response.Write "</td></tr></table><br></td></tr></table>"
End Sub
Sub Add_New()
Response.Write "<form name=""form"" method=""post"" action=""book.asp"" onsubmit=""return checkBook();"">" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td width=""80"">您的姓名:</td>" & vbCrLf
Response.Write "<td width=""300""><input type=""text"" name=""name"" maxlength=""14"" size=""20"" class='lanyu' autocomplete=""off"">   <font color=red>*</font></td>" & vbCrLf
Response.Write "</tr>" & vbCrLf
Response.Write "<tr>" & vbCrLf
Response.Write "<td>您的性别:</td>" & vbCrLf

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -