📄 xinwenadd.asp
字号:
<!--#include file="../conn.asp"-->
<!--#include file="../check.asp"-->
<!--#include file="../html.asp"-->
<%
dim xid,sql1,theACT,biaoti,neirong,rs,temp,riqi
call LinkData()
theACT=request("theACT")
if theACT="SAVE" then
biaoti=request("biaoti")
neirong=request("neirong")
riqi=Date()
'response.write biaoti&neirong
If biaoti="" Or neirong="" Then
response.write "请<a href='javascript:history.go(-1);'>返回</a>按照提示填写完整,如果禁用了javascript,请启用"
response.End
End If
sql1="select * from xinwen where xid=1"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open sql1,conn,1,3
rs.addnew
rs("biaoti")=biaoti
rs("neirong")=html(neirong)
rs("riqi")=riqi
rs.update
rs.close
temp="xinwen.asp"
response.Redirect (temp)
end If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>知识增加</title>
<link href="../teacher.css" rel="stylesheet" type="text/css">
<script language="javascript">
function notNull(fieldname,string)
{
if (string.value == "") {
alert(fieldname+"不能为空");
string.focus();
return false;
}
return true;
}
function check(myform)
{
if (notNull(" 标题 ",myform.biaoti)&¬Null(" 内容 ",myform.neirong))
return true;
return false;
}
</script>
</head>
<body>
<form method="post" action="xinwenadd.asp" name="form1" onsubmit="return check(this)">
<table border="0" width="98%" cellspacing="2" cellpadding="2" align="center">
<tr>
<td colspan="2" align="center">知识增加</td>
</tr>
<tr>
<td>标题</td>
<td><input name="biaoti" type="text" id="biaoti" size="40">
</td>
</tr>
<tr>
<td>知识</td>
<td><textarea name="neirong" cols="100" rows="15" id="neirong"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="提交">
<input type="reset" value="重写">
<input name="theACT" type="hidden" id="theACT" value="SAVE">
</td>
</tr>
</table>
</form>
</body>
</html>
<%
call CloseData()
'call Timenum()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -