📄 news_edit.asp
字号:
<!--#include file="admin.asp"-->
<%
chk_admin_login(2)
if Request.QueryString("action")="save" then
id=request("id")
newstype=Trim(Request.Form("type"))
title=request("title")
content=Request("content")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from [news] where id="&id
rs.open sql,conn,1,3
rs("type")=newstype
rs("title")=title
if Request.Form("color")<>empty then rs("titlecolor")=Request.Form("color")
rs("content")=content
rs.update
rs.close
response.write"<script>alert('更新成功!');location.href='news_admin.asp'</script>"
end if
%>
<%
id=request.querystring("id")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From [news] where id="&id, conn,3,3
%>
<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="news_edit.asp?action=save" onSubmit="return CheckForm(this);">
<input type=hidden name=id value=<%=id%>>
<input name="content" type="hidden" value='<%=rs("content")%>'>
<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="type" id="type">
<%do while not rs2.eof%>
<option value="<%=rs2("id")%>" <%if rs2("id")=cint(rs("type")) then Response.Write " selected"%>><%=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" value="<%=rs("title")%>" style="color:<%=rs("titlecolor")%>">
<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="a3">
<td>
内 容</td>
<td height="250"><SCRIPT src="inc/post.js"></SCRIPT></td>
</tr>
<tr align="center" class="a4">
<td colspan="2"> <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 + -