📄 laoshiadd.asp
字号:
<!--#include file="../conn.asp"-->
<!--#include file="../check.asp"-->
<!--#include file="../html.asp"-->
<!--#include file="../md5.asp"-->
<%
dim tid,sql1,theACT,jieshao,rs,temp,yonghu,mima
call LinkData()
theACT=request("theACT")
if theACT="SAVE" then
laoshi=Trim(request("laoshi"))
jieshao=Trim(request("jieshao"))
yonghu=Trim(request("yonghu"))
mima=Trim(request("mima"))
'response.write laoshi&jieshao
If laoshi="" Or jieshao="" Or mima="" Or yonghu="" Then
response.write "请<a href='javascript:history.go(-1);'>返回</a>按照提示填写完整,如果禁用了javascript,请启用"
response.End
End If
sql1="select * from teacher where tid=1"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open sql1,conn,1,3
rs.addnew
rs("laoshi")=laoshi
rs("jieshao")=html(jieshao)
rs("yonghu")=yonghu
rs("mima")=md5(mima)
rs.update
rs.close
temp="laoshi.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.yonghu)&¬Null(" 密码 ",myform.mima)&¬Null(" 姓名 ",myform.laoshi)&¬Null(" 介绍 ",myform.jieshao))
return true;
return false;
}
</script>
</head>
<body>
<form method="post" action="laoshiadd.asp" name="form1" onsubmit="return check(this)">
<table border="0" width="90%" cellspacing="2" cellpadding="2" align="center">
<tr>
<td colspan="2" align="center">教师增加</td>
</tr>
<tr>
<td>用户名</td>
<td><input name="yonghu" type="text" id="yonghu" size="12" maxlength="10"></td>
</tr>
<tr>
<td>密码</td>
<td><input name="mima" type="text" id="mima" size="16" maxlength="14"></td>
</tr>
<tr>
<td>姓名</td>
<td><input name="laoshi" type="text" id="laoshi" size="10" maxlength="5">
</td>
</tr>
<tr>
<td>介绍</td>
<td><textarea name="jieshao" cols="100" rows="10" id="jieshao"></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 + -