📄 add_news.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="session.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加新闻</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
td { font-family: "Arial", "Helvetica", "sans-serif"; font-size: 12px; font-style: normal; line-height: 20px; font-weight: normal; font-variant: normal}
a:link {
font-family: Arial, Helvetica, sans-serif;
color: #336699;
}
a:visited {
font-family: Arial, Helvetica, sans-serif;
color: #336699;
}
a:hover {
font-family: Arial, Helvetica, sans-serif;
color: #FF6600;
text-decoration: underline;
}
-->
</style></head>
<SCRIPT language=JavaScript>
<!--
function form1_onsubmit()
{
if (document.form1.y_title.value=="")
{
alert("新闻标题一定要填写")
document.form1.y_title.focus()
return false
}
else if(document.form1.y_name.value=="")
{
alert("发布人一定要填写")
document.form1.y_name.focus()
return false
}
}
-->
</SCRIPT>
<body><center>
<% if request.form("sub")="sub" then
y_title=trim(request.form("y_title"))
y_name=trim(request.form("y_name"))
y_content=trim(request("y_content"))
set rs=server.CreateObject("adodb.recordset")
sql="select * from y_news"
rs.open sql,conn,3,3
rs.addnew
rs("y_title")=y_title
rs("y_name")=y_name
rs("y_content")=y_content
rs("y_time")=date()
rs.update
response.Redirect("list.asp")
response.End()
end if
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="293" align="center" valign="top"><br>
<br>
<form name="form1" method="post" action="add_news.asp" onSubmit="return form1_onsubmit()"><table width="72%" height="189" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center">
<td height="22" colspan="2">添加新闻‖<a href="list.asp">返回</a>‖</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="15%" height="27" align="right">新闻主题:</td>
<td width="85%" align="left"><input name="y_title" type="text" id="y_title" size="30"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="28" align="right">发布人::</td>
<td align="left"><input name="y_name" type="text" id="y_name" size="20"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="right">新闻内容:</td>
<td align="left"><INPUT type="hidden" name="y_content" value=""><iframe ID="eWebEditor1" src="ewebeditor/ewebeditor.asp?id=y_content&style=standard" frameborder="0" scrolling="no" width="500" HEIGHT="350"></iframe></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td colspan="2"><input type="submit" name="Submit" value="提交">
<input type="submit" name="Submit2" value="取消">
<input type="hidden" name="sub" value="sub"></td>
</tr>
</table>
</form></td>
</tr>
</table></center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -