📄 news_edit.asp
字号:
<%
if session("admin")<>"smallstick" then
response.redirect "login.asp"
response.end
end if
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改新闻</title>
<SCRIPT language=JavaScript>
function CheckInput(){
if(input.newstitle.value==''){
alert("新闻标题不能为空!");
input.newstitle.focus();
return false;
}
if(input.newscontent.value==''){
alert("新闻内容不能为空!");
input.newscontent.focus();
return false;
}
return true;
}
</SCRIPT>
<LINK href="../style.css" type=text/css rel=stylesheet>
</head>
<body>
<table width="600" border="0">
<tr>
<td align="center">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from news where news_id="&request("news_id")
rs.open sql,conn,1,3
if rs.eof or rs.bof then
%>
<table width="98%" border="1">
<tr>
<td>找不到该条新闻!</td>
</tr>
</table>
<%else%>
<form action="news_edit_save.asp" method="post" name="input" id="input" onsubmit=return(CheckInput())>
<table width="98%" border="1">
<tr>
<td align="right">新闻标题:</td>
<td><input name="newstitle" type="text" id="newstitle" value="<%=rs("news_title")%>"></td>
</tr>
<tr>
<td align="right">新闻内容:</td>
<td><textarea name="newscontent" cols="40" rows="8" id="newscontent"><%=rs("news_content")%></textarea></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="Submit" value="提交"> <input type="reset" name="Submit2" value="重置">
<input name="news_id" type="hidden" id="news_id" value="<%=request("news_id")%>"></td>
</tr>
</table>
</form>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
%>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -