📄 news_add.asp
字号:
<!--#include file="admin.asp"-->
<%chk_admin_login(1)%>
<%
if Request.QueryString("action")="add" then
newstype=Trim(Request.Form("type"))
title=server.htmlencode(Trim(Request("title")))
content=server.htmlencode(Trim(Request("content")))
If newstype="" Then
response.write "SORRY <br>"
response.write "请选择新闻类型!!<a href=""javascript:history.go(-1)"">返回重输</a>"
response.end
end if
If title="" Then
response.write "SORRY <br>"
response.write "请输入更新内容的标题!!<a href=""javascript:history.go(-1)"">返回重输</a>"
response.end
end if
If content="" Then
response.write "SORRY <br>"
response.write "内容不能为空!!<a href=""javascript:history.go(-1)"">返回重输</a>"
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from news"
rs.open sql,conn,1,3
rs.addnew
rs("type")=newstype
rs("title")=title
rs("content")=content
rs("counter")=0
rs("time")=Date()
rs.update
rs.close
response.write"<script>alert('添加信息成功!');location.href='news_admin.asp'</script>"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="550" border="1" align="center" cellpadding="4" cellspacing="0" class="table-line">
<form method="post" action="?action=add">
<tr class="td-title-color">
<td colspan="2" align="center"><table border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="shadow">增加新闻</td>
</tr>
</table> </td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="center">新闻类型</td>
<td><select name="type" id="select">
<option selected value="">请选择</option>
<option value="news">最新公告</option>
<option value="help">帮助信息</option>
</select></td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td align="center">标 题</td>
<td><input type="text" name="title" class="input" maxlength="30" size="25"></td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td>
<div align="center">UBB代码</div></td>
<td><script src=../Inc/ubbcode.js></script>
<!--#include file="../inc/ubb.inc" --> </td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td><div align="center">内 容</div></td>
<td>
<textarea name="content" cols="57" rows="12" wrap="PHYSICAL"></textarea></td>
</tr>
<tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
<td colspan="2" align="center">
<input name="submit" type="submit" value="确定">
<input name="reset" type="reset" onClick="javascript:history.back()" value="取消"> </td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -