?? manage_addbook.asp
字號:
<%@ LANGUAGE="VBScript" %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/articlechar.inc"-->
<%
if Request.QueryString("no")="yes" then
id= Trim(Request("id"))
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "DELETE FROM book Where id="&id,Conn,2,3,1
Set Rs= Nothing
Response.Redirect "Manage_AddBook.asp"
end if
if Request.QueryString("mark")="southidc" then
If request.form("title")="" Then
Response.Write("<script language=""JavaScript"">alert(""錯誤:您沒輸入標題,請返回檢查?。?quot;");history.go(-1);</script>")
response.end
end if
If request.form("content")="" Then
Response.Write("<script language=""JavaScript"">alert(""錯誤:您沒輸入留言內容,請返回檢查!!"");history.go(-1);</script>")
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select top 1 * from book where name='管理員'"
rs.open sql,conn,1,3
rs.addnew
if request.form("html")="on" then
rs("content")=request.form("content")
else
rs("content")=htmlencode2(request.form("content"))
end if
rs("name")=request.form("name")
rs("title")=request.form("title")
rs("time")=date()
rs.update
rs.close
response.redirect "Manage_AddBook.asp"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from book where name='管理員'"
rs.open sql,conn,1,3
%>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"> <br>
<table width="560" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td height="28" class="back_southidc">
<div align="center"><strong>發布管理員公告 <br>
</strong></div></td>
</tr>
<tr class="tr_southidc">
<form method="POST" action="Manage_AddBook.asp?mark=southidc">
<input type=hidden readonly name="Name" value="管理員">
<td><div align="center">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr bgcolor="#A4B6D7">
<td width="27%" height="25">
<div align="center">標 題</div></td>
<td width="73%">
<input type="text" name="title" size="45"></td>
</tr>
<tr>
<td height="22">
<div align="center">內 容</div></td>
<td>
<textarea rows="8" name="Content" cols="45"></textarea>
</td>
</tr>
<tr bgcolor="#A4B6D7">
<td height="25" colspan="2">
<div align="center">是否支持html
<input type="checkbox" name="html" value="on">
<input type="submit" value="提交公告" name="B1">
<input type="reset" value="全部重寫" name="B2">
</div></td>
</tr>
</table>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#000000">
<tr bgcolor="#ECF5FF">
<td width="63%" height="25" bgcolor="#ECF5FF"> <div align="center">公告標題</div>
<div align="center"></div></td>
<td width="18%"> <div align="center">加入時間</div></td>
<td width="9%"> <div align="center">操作</div></td>
<td width="10%"> <div align="center">操作</div></td>
</tr>
<% do while not Rs.eof %>
<tr bgcolor="#ECF5FF">
<td height="22" bgcolor="#ECF5FF"> <div align="center"> <%=rs("Title")%></div>
<div align="center"></div></td>
<td> <div align="center"><%= FormatDateTime(rs("time"),2) %></div></td>
<td> <div align="center"><a href="Manage_editBook.asp?id=<%=Rs("id")%>">修改</a></div></td>
<td> <div align="center"><a href="Manage_AddBook.asp?id=<%=Rs("id")%>&no=yes">刪除</a></div></td>
</tr>
<%Rs.MoveNext
loop
%>
</table>
</div></td>
</form>
</tr>
</table>
<br> <br> </td>
</tr>
</table>
<%
Set Rs = Nothing
Set Conn = Nothing
rs.close
Conn.close
%>
<!-- #include file="Inc/Foot.asp" -->
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -