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

📄 book.asp

📁 不错的asp论坛,大家可以看看啊和呵呵.
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="inc/config.asp"-->
<!--#include file="mdb.asp"-->
<!--#include file="inc/inc.asp"-->

<%
page = Request.QueryString("page")
action = Request.QueryString("action")
action_e = Request.Form("action_e")
call head
call menu%>

<head>
</head>

<TABLE bgcolor="#000000" align=center border=1 cellPadding=0 cellSpacing=0 width=760 borderColor="<%=border%>" frame=vsides rules=none>
<TBODY>
<TR>
<td height="24" align="right">
<%call Main_Menu()%>
</TD>
</TR>
<TR>
<TD width="760" background="img/menu_bg2.gif" height="4"></TD>
</TR>
</TBODY>
</TABLE>
<TABLE align=center border=1 cellPadding=0 cellSpacing=0 width=760 borderColor="<%=border%>" frame=vsides rules=none>
<TBODY>
<TR>
<td width=204 align=left vAlign=top background=img/left_bg.gif>
<TABLE width=100% border=0 align=center cellPadding=0 cellSpacing=0>
<TBODY>
<TR><td width=204><img src=img/left_top.gif usemap="#Map" border="0"><map name="Map"><area shape="rect" coords="41, 11, 67, 24" href="book.asp" title="留言本"><area shape="rect" coords="114, 8, 164, 28" href="../ryxs/default.asp" title="如影相随纯文学网站"></map></td></tr>
</table>
<TABLE width=196 border=0 align=left cellPadding=0 cellSpacing=0>
<TBODY>
<TR>
<td align=center height="24" background="img/title.jpg"><strong>
<font color="#FFFFFF">流星情缘留言本</font></strong></td>
</tr>
<TR>
<td>
<p><font color="#1E90FF"><br>&nbsp;<br>&nbsp;                           
&nbsp;&nbsp; * 我们渴望自由的交流,也渴望完美,希望我们的生活,没有地域、文化、商业上的限制!</font>                          
</p>
<p><font color="#1E90FF">&nbsp;&nbsp;</font><font color="#1E90FF"> *                       
流星情缘只限做为技术交流及程序演示的主页。</font>   
</p>
<p><font color="#1E90FF">&nbsp;&nbsp;</font><font color="#1E90FF"> *                       
此留言本不等同空间里的留言簿不做聊天,只限设计信息交流!</font>   
</p>
<p><font color="#1E90FF">&nbsp; *&nbsp;                       
如有设计,技术上的困难,流星情缘将在7个工作日里,为你免费解答!</font>   
</p>
<p><font color="#1E90FF">&nbsp;&nbsp;&nbsp;</font><font color="#008000"> </font>   
</p>
<p><font color="#1E90FF">&nbsp;&nbsp;&nbsp;</font>   
</p>
</table>
</TD>
<td width=1 height="190" background="img/xu.gif"></TD>
<td width=553 align=left vAlign=top bgcolor="#000000" bordercolorlight="#000000" bordercolordark="#000000"><%call br%><%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'主程序

Select Case action_e
	Case ""
	Case "Add_New"
		Call Add_New_Execute()


	Case "reply"
if session("adminlogin")<>sessionvar then
Response.write "<script language = 'javascript'>alert('您还未登陆管理,无法进行回复留言!');window.document.location.href='book.asp';</script>"
else
		Call Reply_Execute()
end if

	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 "reply"
		Call Reply()
	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() %>
&nbsp;<img src=img/none.gif border=0><img src=img/link2.gif border='0'>&nbsp;<a href="book.asp?action=Add_New">添加留言</a>&nbsp;<img src=img/none.gif border=0><img src=img/link2.gif border='0'>&nbsp;<a href="book.asp?action=View_Words">查看留言</a>&nbsp;&nbsp;
<% End Sub 
'查看留言
Sub View_Words() 
		Set Rs = Server.CreateObject("ADODB.RecordSet")
		Sql="Select * From words Order By date Desc"
		Rs.Open Sql,Conn,1,1
		TotalRecord=Rs.RecordCount
		Rs.PageSize = 5
		PageSize = Rs.PageSize
		PageCount=Rs.PageCount
		If page="" Then  
			Rs.AbsolutePage = 1
			page=1
		Else
			Rs.AbsolutePage = page
		End If
%>
	<%
    do while i < PageSize And not rs.eof 
	%>
<div align="center">
<table width="520" cellspacing="1" cellpadding="0" bgcolor="#808080"><tr bgcolor="#f7f7f7">
	<table width="520" align=center cellspacing="1" cellpadding="0" bgcolor="#333333"><tr bgcolor="#333333"><td rowspan=2 width=90 bgcolor="#000000"><center><font color=#ff6600><%=Rs("name")%></font><br><%if Rs("sex")="0" then%><img src=img/yao.gif><%elseif Rs("sex")="1" then%><img src=img/boy.gif><%elseif Rs("sex")="2" then%><img src=img/girl.gif><%End If%></center></td>
<td bgcolor="#000000" height=20 bordercolorlight="#808080" bordercolordark="#808080"><table border=0 cellpadding=0 cellspacing=0 width="100%"><tbody><tr><td valign=bottom width="40%"><font color=#000000>&nbsp;<%=Rs("date")%></font></td><td align=right width="60%"><%If Rs("city")<>"" Then%><img align=absBottom title="<%=Rs("name")%>来自<%=Rs("city")%>" border=0 height=16 src="img/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/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/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/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/web.gif" width=16 title="去<%=Rs("name")%>的主页看看"></a>&nbsp;<%End If%><img align=absBottom title="<%=Rs("name")%>的IP地址为<%=Rs("ip")%>" height=16 src="img/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/Delete.gif" width=16></a>&nbsp;<a href="book.asp?action=reply&id=<%=Rs("id")%>"><img align=absBottom border=0 title="【回复】" height=16 src="img/reply.gif" width=16></a>&nbsp;<a href="book.asp?action=Edit&id=<%=Rs("id")%>"><img align=absBottom border=0 title="【编辑】" height=16 src="img/edit.gif" width=16></a>&nbsp;<%End if%></td></tr></tbody></table></td></tr>
<tr> 
	<td bgcolor="#000000" height=80 bordercolorlight="#808080" bordercolordark="#808080"> <table border=0 cellpadding=0 cellspacing=2 width="100%">
<tbody><tr><td style="word-break:break-all;line-height:150%"><%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 %><font color=#1E90FF>****以下为管理员可见内容!****</font><br>
[<%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%><font color=#1E90FF>****秘密留言!管理员可见!****</font>
<%End If%></td></tr><%If Rs("reply")<>"" Then%><tr>
		<td height="20" bgColor=#000000><img src=img/fu.gif>:<font color=red><%=Ubb(unHtml(Rs("reply")))%></font></td></tr><%End If%></table></td></tr></table>
</div>
<%call br%>
<%
		 
		rs.movenext
		i=i+1
    	loop
		Rs.Close
		Set Rs = Nothing
dim n
n= TotalRecord \ PageSize
		%>
<TABLE cellSpacing=1 cellPadding=0 width="520" align=center border=0 bgcolor="#999999">
<TBODY>
<form action="" method=post onChange="submit()">
<TR> 
<TD align=middle width="35%" height=25 bgcolor="#000000"><font color="#FFFFFF"><IMG height=14 src="img/cha.gif" width=14 align=absMiddle> 共[<%=TotalRecord%>]个留言 分[<%=n+1%>]页</font></TD>
<TD width="40%" align=middle bgcolor="#000000"><font color="#FFFFFF"><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?page=1>首页</a> "
response.write "<a href=book.asp?page="&Page-1&">上一页</a> "
end if
if n-page<0 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href=book.asp?page="&(Page+1)
response.write ">下一页</a> <a href=book.asp?page="&n+1&">尾页</a>"
end if%>
<IMG height=11 src="img/gt.gif" width=11 align=absMiddle></font></TD>
<TD align=middle width="25%" bgcolor="#000000">
<font color="#FFFFFF">
<select name="select" onChange='javascript:window.open(this.options[this.selectedIndex].value,"_top")' class="lanyu">
<%For m = 1 To PageCount%>
      <option value="book.asp?page=<%=m%>">第<%=m%>頁</option>
      <%
    Next
    %>
</select><input type="submit" name="Submit2" value="轉向" class="button"> </font> </TD>
</TR>
</FORM>
</TABLE><br></td></tr></table>
<% End Sub
'添加一条新留言
Sub Add_New()%>
<table width="520" border="0" cellspacing="1" cellpadding="0" align="center"><tr><td> 
<table width="450" cellpadding="1" cellspacing="0" align="center" >
<form name="new" method="post" action="book.asp?Add_New_Execute">
<tr>
<td width="80"><font color="#FFFFFF">您的姓名:</font></td>
<td width="300"><input type="text" name="name" maxlength="255" size="20" class='lanyu'>   <font color=red>*</font></td>
</tr>
<tr> 
<td><font color="#FFFFFF">您的性别:</font></td>
<td><input type="radio" name="SEX" value="1" checked><b><font color="#008000">我是男生  
</font></b> <input type="radio" name="SEX" value="2"><b><font color="#0000FF">我是女生</font></b></td>
</tr>
<tr> 
<td><font color="#FFFFFF">电子邮箱:</font></td>
<td><input type="text" name="email" maxlength="255" size="20" class='lanyu'></td>
</tr>
<tr> 
<td><font color="#FFFFFF">腾迅 QQ:</font></td>
<td><input type="text" name="qq" maxlength="255" size="20" class='lanyu'></td>
</tr>
<tr> 
<td><font color="#FFFFFF">个人主页:</font></td>
<td><input type="text" name="web" maxlength="255" size="20" class='lanyu'></td>
</tr>
<tr> <td><font color="#FFFFFF">来自哪里:</font></td>
<td><input type="text" name="city" maxlength="255" size="20" class='lanyu'></td>
</tr>
<tr><td><font color="#FFFFFF">类型选择:</font></td>
<td><input type="radio" name="title" value="1" checked><font color=#0000FF>留言</font> <input type="radio" name="title" value="2"><font color="#FF00FF">技术</font> <input type="radio" name="title" value="3"><font color=#FF7F50>报错</font> <input type="radio" name="title" value="4"><font color=#228B22>链接</font> <input type="radio" name="title" value="5"><font color=#1E90FF>其它</font></td>
</tr>
<tr> 
<td valign="middle"><font color="#FFFFFF">留言内容: <br></font></td>
<td  valign="top"><textarea name="words" cols="40" rows="6" class='lanyu'></textarea></td>
</tr>
<tr> 
<td valign="middle"><font color="#FFFFFF">是否隐藏:</font></td>
<td valign="top"> 
<input type="radio" name="admin" value="0" checked><font color="#FFFFFF"> 否 <input type="radio" name="admin" value="1"> 是&nbsp;&nbsp;* 选择隐藏后,此留言只有管理员可以看到。</font></td>
</tr><tr> 
<td align="center"  height="40" colspan="2"> 
<input type="hidden" name="action_e" value="Add_New"> <input type="submit"  class='button' name="Submit" value="提交" > 
        <input type="reset" name="Submit2" value="重写"  class='button'>
</td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<% End Sub
'编辑留言
Sub Edit()
Set Rs = Server.CreateObject("ADODB.RecordSet")
Sql="Select * From words Where id="&Request.QueryString("id")
Rs.Open Sql,Conn,1,1
%>
<table width="400" align=center cellspacing="1" cellpadding="5" bgcolor="#cccccc">
<form name="reply" method="post" action="book.asp">
<tr bgcolor="#f7f7f7">
 <TD align="center" bgcolor="#000000"><b><font color="#FFFFFF">来客留言内容</font></b></TD></tr>
<tr bgcolor="#f7f7f7">
<td align="center" bgcolor="#000000"><font color="#FFFFFF">
<textarea name="words" cols="50" rows="5" class='lanyu' style="font-weight: 700"><%=Rs("words")%></textarea></font></td></tr>
<tr bgcolor="#f7f7f7">
 <TD align="center" bgcolor="#000000"><b><font color="#FFFFFF">回复内容</font></b></TD></tr>
<tr bgcolor="#f7f7f7">
<td align="center" bgcolor="#000000"><font color="#FFFFFF">
<textarea name="reply" cols="50" rows="5" class='lanyu' style="font-weight: 700"><%=Rs("reply")%></textarea></font></td></tr>
<tr align="center" bgcolor="#f7f7f7"><td colspan="2" bgcolor="#000000">
	<font color="#FFFFFF">
	<input type="hidden" name="action_e" value="Edit" style="font-weight: 700">
        <input type="hidden" name="id" value="<%=Request.QueryString("id")%>" style="font-weight: 700">
        </font><font color="#FFFFFF">
        <input type="submit" name="Submit" value="修改留言" id="Submit" class="input1" style="font-weight: 700"></font></td></tr>
</form>

⌨️ 快捷键说明

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