📄 newsedit.asp
字号:
<!--#include file="../conndb.asp"-->
<!--#include file="isAdmin.asp"-->
<html>
<head>
<title>网上人才中心系统</title>
<link href=../style.css rel=STYLESHEET type=text/css>
<script language="javascript">
function checkFields()
{
if (myform.title.value=="") {
alert("新闻题目不能为空");
myform.title.onfocus();
return false;
}
if (myform.content.value=="") {
alert("新闻内容不能为空");
myform.content.onfocus();
return false;
}
return true;
}
</script>
</head>
<body>
<%
'从数据库中取得此新闻信息
dim id,rs,sql
'参数id表示新闻编号
id = request.QueryString("id")
sql = "Select * from News Where id = " & id
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql, Conn, 1, 1
If rs.EOF Then
Response.Write "没有此新闻"
Response.End
Else
content = Replace(rs("content"),"<br>",chr(13))
content = Replace(content," "," ")
%>
<form name="myform" method="POST" action="NewsSave.asp?action=edit&id=<%=id%>" OnSubmit="return checkFields()">
<table border="0" width="100%" cellspacing="1">
<tr>
<td width="100%">新闻标题
<input type="text" name="title" size="20" value="<%=rs("title")%>"></td>
</tr>
<tr>
<td width="100%">新闻内容</td>
</tr>
<tr>
<td width="100%"><textarea rows="12" name="content" cols="55"><%=content%></textarea></td>
</tr>
</table>
<p align="center"><input type="submit" value=" 提 交 " name="B1">
<input type="reset" value=" 重写 " name="B2"></p>
<%End If%>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -