📄 news.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="session.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body oncontextmenu="return false" onselectstart="return false" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div align="center">
<script laguage="javascript">
<!--
function form1_onsubmit()
{
if (document.form1.dy_name.value=="")
{
alert("出处不能为空!")
document.form1.dy_name.focus()
return false
}
else if(document.form1.dy_content.value=="")
{
alert("新闻内容不能为空!")
document.form1.dy_content.focus()
return false
}
}
-->
</script>
<form name="form1" method="post" action="news.asp" onSubmit="return form1_onsubmit()">
<table width="497" height="190" border="0" cellpadding="0" cellspacing="1" bgcolor="#FF0000">
<tr align="center" bgcolor="#009900">
<td height="29" colspan="2"><font color="#FFFFFF">新闻更新</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="141" align="right">来自:</td>
<td width="353"><input name="dy_name" type="text" id="dy_name"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="86" align="right">新闻内容:</td>
<td align="left" valign="top"><textarea name="dy_content" cols="20" rows="5" id="dy_content"></textarea></td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td colspan="2">
<input type="submit" name="submit" value="提交">
<input type="reset" name="submit2" value="重置"></td>
</tr>
</table>
</form>
<% if request.form("submit")="提交" then
dy_name=trim(request.form("dy_name"))
dy_content=trim(request.form("dy_content"))
if dy_name="" or dy_content="" then
%>
<script language="JavaScript">
alert("出处和内容必须写!")
history.go(-1)</script><%
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from dy_news"
rs.open sql,conn,3,3
rs("dy_name")=dy_name
rs("dy_content")=dy_content
rs.update
%>
<script language="JavaScript">
alert("新闻更新成功!")
window.location.href("main.htm")</script>
<% rs.close
set rs=nothing
conn.close
set conn=nothing
end if
end if%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -