📄 news.asp
字号:
<!--#include file="config.asp"-->
<%
on error resume next
set rs = server.createobject("adodb.recordset")
sql = "select * from config"
rs.open sql,conn,1,1
if date <> idate then
rs("today") = 0
end if
rs("date") = date
rs.update
rs.close
if request.cookies("iadmin") <> "admin" then
set rs = nothing
conn.close
set conn = nothing
response.redirect "manage.asp"
response.end
else
iaction = request("action")
if iaction = "news" and request.cookies("iadmin") = "admin" then
icontent = request.form("content")
itime = now
if icontent = "" or itime = "" then
ierror = "数据内容不得为空"
end if
if ierror = "" then
sql = "select * from news"
rs.open sql,conn,3,2
rs.addnew
rs("news") = icontent
rs("date") = itime
rs.update
rs.close
end if
end if
if iaction = "delete" and request.cookies("iadmin") = "admin" then
iid = request("id")
sql = "delete * from news where id = " & iid
rs.open sql,conn,3,1
rs.close
end if
end if
%>
<html>
<head>
<!--- The site is designed by Wind Song Studio --->
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="author" content="webmaster@i986.com">
<meta name="description" content="风雅颂工作室,Wind Song Studio.">
<meta name="keywords" content="风雅颂,工作室,设计,Studio,Wind,Song,Design">
<link href="style.css" rel="stylesheet" type="text/css">
<title><%=ititle%></title>
</head>
<body bgcolor="#EEEEEE" topmargin="0" leftmargin="0">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800">
<tr>
<td width="100" background="images/main/left.gif"> </td>
<td width="600" bgcolor="#FFFFFF">
<img border="0" src="images/main/top.jpg"></td>
<td width="100" background="images/main/right.gif"> </td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="800" height="100%">
<tr>
<td width="100" background="images/main/left.gif"> </td>
<td width="600" bgcolor="#FFFFFF" valign="top">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="580">
<tr>
<td width="5%" align="center">
<img border="0" src="images/main/now.gif"></td>
<td width="35%">
<p style="margin-top: 2"><a href="<%=iurl%>"><%=ihomepage%></a><span style="font-size: 6pt">>></span>管理公告</td>
<td width="20%" align="center">
<a href="new.asp">
<img border="0" src="images/main/new.jpg"></a></td>
<td width="20%" align="center">
<a href="index.asp">
<img border="0" src="images/main/list.jpg"></a></td>
<td width="20%" align="center">
<a href="manage.asp">
<img border="0" src="images/main/manage.jpg"></a></td>
</tr>
</table>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="590">
<tr><td> 管理留言请不要退出<b><font color="#800000"><a href="index.asp"><font color="#800000">回到前台</font></a></font></b>,基本设置请<b><a href="manage.asp"><font color="#800000">点击此处</font></a></b>.
<table border="0" cellpadding="2" cellspacing="1" style="border-style:solid; border-width:1; border-collapse: collapse" bordercolor="#C1C1C1" width="100%" id="AutoNumber5">
<%
sql = "select * from news"
rs.open sql,conn,1,1
itr = 1
if not rs.eof or rs.bof then
do while not rs.eof
if itr\2 = itr/2 then
ibgcolor = icolor2
else
ibgcolor = icolor3
end if
%>
<tr>
<td width="100%" bgcolor="<%=ibgcolor%>"><%=rs("news")%> ( <a href="news.asp?action=delete&id=<%=rs("id")%>">点此删除</a> )</td>
</tr>
<%
itr = itr + 1
rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber6" height="5">
<tr>
<td width="100%"></td>
</tr>
</table>
<table border="0" cellpadding="2" cellspacing="1" style="border-collapse: collapse; border-style: solid; border-width: 1" bordercolor="#C1C1C1" width="100%" id="AutoNumber1">
<form name="news" method="post" action="news.asp" target="_self">
<tr>
<td width="100%" colspan="2" bgcolor="<%=icolor1%>"><p align="center" style="margin-top: 2"><b><font color="#800000"><%=ierror%></font></b> </td>
</tr>
<tr>
<td width="20%" bgcolor="<%=icolor2%>" align="center">
<p align="center" style="margin-top: 2"><font color="#800000">公告内容</font></td>
<td width="80%" bgcolor="<%=icolor2%>">
<textarea rows="5" name="content" cols="100" style="width: 200; color: #C1C1C1"></textarea></td>
</tr>
<tr>
<td width="20%" bgcolor="<%=icolor3%>" align="center"> </td>
<td width="80%" bgcolor="<%=icolor3%>">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="30%" id="AutoNumber4">
<tr><input type="hidden" name="action" value="news">
<td width="50%">
<a target="_self" href="javascript:document.news.submit()"><img border="0" src="images/main/ok.gif"></a></td>
<td width="50%">
<a target="_self" href="javascript:document.news.reset()"><img border="0" src="images/main/cancel.gif"></a></td>
</tr>
</table>
</td>
</tr>
</table>
</td></tr>
</form>
</table>
</center>
</div>
<%
response.write ibottom
%>
</td>
<td width="100" background="images/main/right.gif"> </td>
</tr>
</table>
</center>
</div>
</body>
</html>
<%
conn.close
set conn = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -