📄 news_add.asp
字号:
<!--#include file="admin.asp"-->
<%
chk_admin_login(1)
if Request.QueryString("action")="add" then
newstype=Request.Form("newstype")
title=server.htmlencode(Trim(Request("title")))
content=Request("content")
if newstype="" Then
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
if Request.Form("color")<>empty then rs("titlecolor")=Request.Form("color")
rs("content")=content
rs("counter")=0
rs.update
rs.close
response.redirect "news_admin.asp"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
<script>
function title_color(color){document.coolform.title.style.color = color;}
</script>
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" class="a2">
<form name="coolform" method="post" action="?action=add" onSubmit="return CheckForm(this);">
<input name="content" type="hidden">
<tr class="a1">
<td height="25" colspan="2" align="center">添加新闻</td>
</tr>
<tr class="a3">
<td width="14%">新闻类型</td>
<td width="86%"> <%
set rs2=server.createobject("ADODB.Recordset")
sql2="select * from newstype"
rs2.open sql2,conn,1,1
%>
<select name="newstype" size="1" id="newstype">
<option value="">请选择</option>
<%do while not rs2.eof%>
<option value=<%=rs2("id")%>><%=rs2("typename")%></option>
<%rs2.movenext
loop
rs2.close
set rs2=nothing
%>
</select> </td>
</tr>
<tr class="a4">
<td>标 题</td>
<td><input type="text" name="title" size="40"><SELECT name=color onChange="title_color(this.options[this.selectedIndex].value)">
<option value="">颜色</option>
<option style=background-color:Black;color:Black value=Black>黑色</option>
<option style=background-color:green;color:green value=green>绿色</option>
<option style=background-color:red;color:red value=red>红色</option>
<option style=background-color:blue;color:blue value=blue>蓝色</option>
<option style=background-color:Navy;color:Navy value=Navy>深蓝</option>
<option style=background-color:Teal;color:Teal value=Teal>青色</option>
<option style=background-color:Purple;color:Purple value=Purple>紫色</option>
<option style=background-color:Fuchsia;color:Fuchsia value=Fuchsia>紫红</option>
<option style=background-color:Gray;color:Gray value=Gray>灰色</option>
<option style=background-color:Olive;color:Olive value=Olive>橄榄</option>
</SELECT></td>
</tr>
<tr class="a4">
<td>内 容</td>
<td height="250"><SCRIPT src="inc/post.js"></SCRIPT></td>
</tr>
<tr class="a4">
<td colspan="2" align="center" class="a3">
<input type="submit" value=" 确 定 " name=EditSubmit>
<input name="reset" type="reset" value=" 取 消 " onClick="javascript:history.back()">
</td>
</tr>
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -