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

📄 book.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%><TABLE bgcolor="#ffffff" 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,11,140,24" 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>留 言 说 明</strong></td>
</tr>
<TR>
<td> 因 为 留 言 众 多 ,站 长&nbsp;<br>
  <br>
  因 为 时 间 的 关 系 不 能 一&nbsp;<br>
  <br>
  一 回 复 , 请 见 量 !</table> 
</TD>
<td width=1 height="190" background="img/xu.gif"></TD>
<td width=553 align=left vAlign=top bgcolor="#ffffff"><%call br%><%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'主程序
Select Case action_e
	Case ""
	
	Case "Add_New"
		Call Add_New_Execute()
	Case "reply"
		Call Reply_Execute()
	Case "admin"
		Call Admin_Login_Execute()
	Case "EditPWD"
		Call EditPWD_Execute()
	Case "Edit"
		Call Edit_Execute()
End Select
Select Case action
Case "Admin_Login"
		Call Admin_Login()
	Case "Exit"
		Call Exit_Admin()
		
		Call View_Words()
		
	Case ""
		
		Call View_Words()
		
	Case "Add_New"
		Call Add_New()
	Case "reply"
		Call Reply()
	Case "View_Words"
		
		Call View_Words()
		
	Case "Delete"
		Call Delete()
		Call View_Words()
	Case "EditPWD"
		Call EditPWD()
	Case "Edit"
		Call Edit()
				
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><% If Session("Admin")="Login" Then %>&nbsp;<img src=img/none.gif border=0><img src=img/link2.gif border='0'>&nbsp;<a href="book.asp?action=Exit">退出管理</a><% Else %>&nbsp;<img src=img/none.gif border=0><img src=img/link2.gif border='0'>&nbsp;<a href="book.asp?action=Admin_Login">管理留言</a><% End If %><% If Session("Admin")="Login" Then %> &nbsp;<img src=img/none.gif border=0><img src=img/link2.gif border='0'>&nbsp;<a href="book.asp?action=EditPWD">修改密码</a><% End If %>&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 = 15
		PageSize = Rs.PageSize
		PageCount=Rs.PageCount
		If page="" Then  
			Rs.AbsolutePage = 1
		Else
			Rs.AbsolutePage = page
		End If
%>
	<% 
    do while i < PageSize And not rs.eof 
	%>
<table width="520" align=center cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr bgcolor="#f7f7f7"><td rowspan=2 width=90><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="#f7f7f7" height=20><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("Admin") = "Login" 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="#ffffff" height=80> <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("Admin") = "Login" 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")))%> 
<%else%><font color=#1E90FF>****秘密留言!管理员可见!****</font> 
<%End If%></td></tr><%If Rs("reply")<>"" Then%><tr><td height="20" bgColor=#ffffff><img src=img/fu.gif>:<font color=red><%=Ubb(unHtml(Rs("reply")))%></font></td></tr><%End If%></table></td></tr></table><%call br%> 
<%
		 
		rs.movenext
		i=i+1
    	loop
		Rs.Close
		Set Rs = Nothing
		%>
<table width="530" height="24" border="0" cellpadding="0" cellspacing="0" align="center"><tr><td width="16" align="right"><img border="0" src="img/title_l.gif"></td><td width="500" background="img/title_bg.gif" align="right"><font color=000000>共有<%=TotalRecord%>条留言</font> 分页  
<%
    For m = 1 To PageCount
    %>
      [<a href="book.asp?page=<%=m%>"><%=m%></a>]  
      <%
    Next
    %>
    &nbsp;</td><td width="14"><img src="img/title_2.gif"></td></tr></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">您的姓名:</td>
<td width="300"><input type="text" name="name" maxlength="255" size="20" class='lanyu'>   <font color=red>*</font></td>
</tr>
<tr> 
<td>您的性别:</td>
<td><input type="radio" name="SEX" value="0" checked>人妖 <input type="radio" name="SEX" value="1">亚当 <input type="radio" name="SEX" value="2">夏娃</td> 
</tr>
<tr> 
<td>电子邮箱:</td>
<td><input type="text" name="email" maxlength="255" size="20" class='lanyu'></td>
</tr>
<tr> 
<td>腾迅 QQ:</td> 
<td><input type="text" name="qq" maxlength="255" size="20" class='lanyu'></td>
</tr>
<tr> 
<td>个人主页:</td>
<td><input type="text" name="web" maxlength="255" size="20" class='lanyu'></td>
</tr>
<tr> <td>来自哪里:</td>
<td><input type="text" name="city" maxlength="255" size="20" class='lanyu'></td>
</tr>
<tr><td>类型选择:</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">留言内容: <br></td>
<td  valign="top"><textarea name="words" cols="40" rows="6" class='lanyu'></textarea></td>
</tr>
<tr> 
<td valign="middle">是否隐藏:</td>
<td valign="top"> 
<input type="radio" name="admin" value="0" checked> 否 <input type="radio" name="admin" value="1"> 是&nbsp;&nbsp;<font color=#009900>*</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>
<% End Sub
'管理员登陆接口
Sub Admin_Login() %>
<table width="400" align=center cellspacing="1" cellpadding="5" bgcolor="#cccccc">
<form name="new" method="post" action="book.asp">
<tr bgcolor="#f7f7f7">
 <TD align="center" colSpan=2>管理登陆</TD></tr>
<tr bgcolor="#f7f7f7">
<td align="right" valign="top" width="105">用 户:</td>
<td width="226"><input type="text" name="admin_name" class='lanyu'></td>
</tr>
<tr bgcolor="#f7f7f7">
<td align="right" valign="top" width="105">密 码:</td>
<td width="226"><input type="password" name="admin_password" class='lanyu'></td></tr>
<tr align="center" bgcolor="#f7f7f7"><td colspan="2"><input type="hidden" name="action_e" value="admin"><input type="submit" name="Submit32" value="登陆" class='button'></td></tr>
</form>
</table><br><br><br><br><br><br><br><br>
<% 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">来客留言内容</TD></tr>
<tr bgcolor="#f7f7f7">
<td align="center" bgcolor="#f7f7f7"><textarea name="words" cols="50" rows="5" class='lanyu'><%=Rs("words")%></textarea></td></tr>
<tr bgcolor="#f7f7f7">
 <TD align="center">回复内容</TD></tr>
<tr bgcolor="#f7f7f7">
<td align="center" bgcolor="#f7f7f7"><textarea name="reply" cols="50" rows="5" class='lanyu'><%=Rs("reply")%></textarea></td></tr>
<tr align="center" bgcolor="#f7f7f7"><td colspan="2"><input type="hidden" name="action_e" value="Edit">
        <input type="hidden" name="id" value="<%=Request.QueryString("id")%>">
        <input type="submit" name="Submit" value="修改留言" id="Submit" class="input1"></td></tr>
</form>
</table><br><br><br><br>
<% End Sub 
'管理员回复留言
Sub Reply() %>
<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">回复留言</TD></tr>
<tr bgcolor="#f7f7f7">
<td width="226" align="center" > <textarea name="reply" cols="50" rows="5" class='lanyu'></textarea></td></tr>
<tr align="center" bgcolor="#f7f7f7"><td><input type="hidden" name="action_e" value="reply"> <input type="hidden" name="id" value="<%=Request.QueryString("id")%>">
						<input type="submit" name="Submit3" value="提交" ID="Submit1" class="input1"> <input type="reset" name="Submit22" value="重写" class="input1"></td></tr>
</form>
</table><br><br><br><br><br><br><br><br>
<% End Sub
'修改资料
Sub EditPWD()%>
<table width="400" align=center cellspacing="1" cellpadding="5" bgcolor="#cccccc">
<form name="new" method="post" action="book.asp">
<tr bgcolor="#f7f7f7">
 <TD align="center" colSpan=2>修改密码</TD></tr>
<tr bgcolor="#f7f7f7">
<td align="right" valign="top" width="105">旧用户名:</td>
<td width="226"><input type="text" name="oldadmin_name" class='lanyu'></td>
</tr>
<tr bgcolor="#f7f7f7">
<td align="right" valign="top" width="105">新用户名:</td>
<td width="226"><input type="text" name="admin_name" class='lanyu'></td></tr>
<tr bgcolor="#f7f7f7">
<td align="right" valign="top" width="105">确认用户:</td>
<td width="226"><input type="text" name="admin_name_c" class='lanyu'></td></tr>
<tr bgcolor="#f7f7f7">
<td align="right" valign="top" width="105">旧 密 码:</td>
<td width="226"><input type="password" name="oldpwd" class='lanyu'></td></tr>
<tr bgcolor="#f7f7f7">
<td align="right" valign="top" width="105">新 密 码:</td>
<td width="226"><input type="password" name="newpwd" class='lanyu'></td></tr>
<tr bgcolor="#f7f7f7">
<td align="right" valign="top" width="105">确认密码:</td>
<td width="226"><input type="password" name="newpwd_c" class='lanyu'>
        <input type="hidden" name="action_e" value="EditPWD"></td></tr>
<tr align="center" bgcolor="#f7f7f7"><td colspan="2"><input type="submit" name="EditPWD" value="修改密码" class='button'></td></tr>
</form>
</table><br><br><br>
<%End Sub%>
<% 
'添加新留言到数据库
Sub Add_New_Execute()
	If Request.Form("name")="" Then
	Response.Write "<script language=javascript>alert('姓名不能为空!');javascript:history.back();</script>"
	Response.End
	End If
	If Len(Request.Form("name"))>20 Then
	Response.Write "<script language=javascript>alert('姓名不能太长!');javascript:history.back();</script>"
	Response.End
	End If
	If Request.Form("email")<>"" Then
	If instr(Request.Form("email"),"@")=0 or instr(Request.Form("email"),"@")=1 or         instr(Request.Form("email"),"@")=len(email) then

⌨️ 快捷键说明

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