modifynews2.asp

来自「这是一个学生毕业时做的教务系统」· ASP 代码 · 共 172 行

ASP
172
字号
<!--#include file=conn.asp -->
<%
IF not(Session("KEY")="super" or Session("KEY")="input") THEN
response.redirect "login.asp"
response.end
END IF

NewsID=request("NewsID")
if NewsID="" then
%>
<script language=javascript>
history.back()
alert("请输入您要修改的新闻ID!")
</script>
<%
Response.End
end if



set rs=server.CreateObject ("ADODB.RecordSet")
rs.Source="select * from News where NewsID=" & NewsID
rs.Open rs.source,conn,1,1


if rs.EOF then
%>
<script language=javascript>
history.back()
alert("非法新闻ID,请确认NewsID不超出当前范围!")
</script>
<%
Response.End
end if


set rs2=server.CreateObject("ADODB.RecordSet")
rs2.Source="select * From BigClass Where BigClassName='" & rs("BigClassName") & "'"
rs2.Open rs2.Source,conn,1,1

set rs3=server.CreateObject("ADODB.RecordSet")
rs3.Source="select * From SmallClass Where SmallClassName='" & rs("SmallClassName") & "'"
rs3.Open rs3.Source,conn,1,1


set rs4=server.CreateObject ("ADODB.RecordSet")
rs4.Source="select * from Special"
rs4.Open rs4.source,conn,1,1
%>
<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href=site.css rel=stylesheet>
</head>

<body>
<p>&nbsp;</p>
<table border="0" width="80%" align=center bgcolor="#000000" cellpadding="3" cellspacing="1">
<tr>
<td colspan="2" height="55" bgcolor="#abb8d6">
<div align="center"><b> 修改新闻--该新闻ID为:<%=NewsID%></b> </div>
</td>
</tr>
<tr>
<td width="17%" align=right bgcolor="#FFFFFF">新闻大类:</td>
<td width="83%" bgcolor="#FFFFFF"><%=rs2("BigClassName")%></td>
</tr>
<tr>
<td width="17%" align=right bgcolor="#FFFFFF">新闻小类:</td>
<td width="83%" bgcolor="#FFFFFF"><%=trim(rs3("SmallClassName"))%></td>
</tr>
<form action=ModifyNews_Class1.asp?NewsID=<%=NewsID%> method=post>
<tr>
<td width=17% bgcolor="#FFFFFF"></td>
<td width="83%" bgcolor="#FFFFFF">
<input name=btn_Modi_class type=submit value="修改新闻类别">
</td>
</tr>
</form>
<form method="POST" action="ModifyNews3_update.asp?NewsID=<%=NewsID%>">
<tr>
<td width="17%" align="right" bgcolor="#FFFFFF">所属专题:</td>
<td width="83%" bgcolor="#FFFFFF">
<select size="1" name="SpecialID">
<option value="0" <%if rs("SpecialID")=0 then Response.Write "selected"%>>-----------------</option>
<%if rs4.EOF then %>
<option value=0>暂无任何专题</option>
<%else
while not rs4.EOF
SpecialID=rs4("SpecialID")
%>
<option value="<%=SpecialID%>" <%if rs("SpecialID")=SpecialID then Response.Write " selected"%>><%=trim(rs4("SpecialName"))%></option>
<%
rs4.MoveNext
wend
end if
%>
</select>
</td>
</tr>
<tr>
<td width="17%" align="right" bgcolor="#FFFFFF">新闻标题:</td>
<td width="83%" bgcolor="#FFFFFF">
<input type="text" name="Title" size="90" value="<%=trim(rs("Title"))%>">
</td>
</tr>
<tr>
<td width="17%" align="right" bgcolor="#FFFFFF">作者:</td>
<td width="83%" bgcolor="#FFFFFF">
<input type="text" name="Author" size="56"  value="<%=trim(rs("Author"))%>">
</td>
</tr>
<tr>
<td width="17%" align="right" bgcolor="#FFFFFF">原出处:</td>
<td width="83%" bgcolor="#FFFFFF">
<input type="text" name="Original" size="56"  value="<%=trim(rs("Original"))%>">
</td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td valign="top" align="right" width="17%"> 文章内容:</td>
<td valign="top" align="left" width="83%">
<textarea rows="15" name="Content" cols="87"><%=trim(rs("Content"))%></textarea>
</td>
</tr>
<tr>
<td width="17%" align="right" bgcolor="#FFFFFF">编码方式:</td>
<td width="83%" bgcolor="#FFFFFF">
<select size="1" name="EnCode">
<option value="html" <%if trim(rs("EnCode"))="Html" or trim(rs("Encode")) ="" then Response.Write "selected"%>>默认方式</option>
<option value="ubb"  <%if trim(rs("EnCode"))="ubb" then Response.Write "selected"%>>UBB</option>
</select>
</td>
</tr>
<tr>
<td width="17%" align="right" bgcolor="#FFFFFF">热点:</td>
<td width="83%" bgcolor="#FFFFFF">
<input type="radio" value="1" <%if rs("hot")=1 then Response.Write "checked"%>  name="hot">
是&nbsp;&nbsp;
<input type="radio" value="0" <%if rs("hot")=0 then Response.Write "checked"%> name="hot">
否</td>
</tr>
<tr>
<td width="17%" align="right" bgcolor="#FFFFFF">图片张数:</td>
<td width="83%" bgcolor="#FFFFFF">
<select size="1" name="image">
<option <%if rs("image")=0 then Response.Write "selected"%>>0</option>
<option <%if rs("image")=1 then Response.Write "selected"%>>1</option>
<option <%if rs("image")=2 then Response.Write "selected"%>>2</option>
<option <%if rs("image")=3 then Response.Write "selected"%>>3</option>
<option <%if rs("image")=4 then Response.Write "selected"%>>4</option>
<option <%if rs("image")=5 then Response.Write "selected"%>>5</option>
<option <%if rs("image")=6 then Response.Write "selected"%>>6</option>
<option <%if rs("image")=7 then Response.Write "selected"%>>7</option>
<option <%if rs("image")=8 then Response.Write "selected"%>>8</option>
<option <%if rs("image")=9 then Response.Write "selected"%>>9</option>
<option <%if rs("image")=10 then Response.Write "selected"%>>10</option>
</select>
<a href="help/index.asp"><font color=336699>使用说明</font></a></td>
</tr>
<tr>
<td height="55" colspan=2 align="center" bgcolor="#abb8d6">
<input type="submit" value="  修改>>  " name="B1">
</td>
</tr>
</form>
</table>

</body>

</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?