📄 adduser.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<%
'添加用户
If NOT IsEmpty (request("addusersubmit")) then
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [user]",conn,1,3
rs.AddNew
rs("id")=trim(request("id"))
rs("name")=trim(request("realname"))
rs("psw")=trim(request("password"))
rs("zhuanye")=trim(request("zhuanye"))
rs("xingbie")=trim(request("xingbie"))
rs.Update
rs.Close
set rs=nothing
call MsgBox("添加成功!","GoUrl","adduser.asp")
end if
%>
<html>
<head>
<style type="text/css">
<!--
body {
font-size:9pt;
}
td {font-size:9pt}
table{font-size:9pt}
.style1 {
color: #E8A477;
font-weight: bold;
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<!--#include file="head.asp"-->
<table width="980" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td height="14" colspan="4" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="980" height="14"></td>
</tr>
</table></td>
</tr>
<tr>
<td width="220" rowspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="30" height="30"><!--#include file="left1.htm"--></td>
</tr>
</table></td>
<td height="22" colspan="3" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="427" height="21" align="center" valign="top"><span class="style1"><font size="+2">添加学生用户</font></span></td>
<td width="333"> </td>
</tr>
<tr>
<td height="1"></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td width="51" height="264"> </td>
<td width="639" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="42" height="264"> </td>
<td width="553" valign="top">
<form name="adduser" method="post" action="adduser.asp" id="adduser">
<table>
<tr>
<td>学号:</td>
<td><input type="text" name="id" id="id"></td>
</tr>
<tr><td height="8"></td></tr>
<tr>
<td>密码:</td>
<Td><input type="text" name="password" id="password"></Td>
</tr>
<tr><td height="8"></td></tr>
<tr>
<Td>真实姓名:</Td>
<td><input type="text" name="realname" id="realname"></td>
</tr>
<tr><td height="8"></td></tr>
<tr>
<td>专业:</td>
<td><input type="text" name="zhuanye" id=" zhuanye"></td>
</tr>
<tr><td height="8"></td></tr>
<tr>
<td>性别:</td>
<td><input type="text" name="xingbie" id="xingbie"></td>
</tr>
<tr><td height="8"></td></tr>
<tr>
<td></td>
<td><input type="submit" name="addusersubmit" value="提交" onClick="return checkuser()"> <input type="reset" value="重写"></td>
</tr>
</table>
</form></td>
<td width="44"> </td>
</tr>
</table></td>
<td width="70"> </td>
</tr>
</table>
<!--#include file="foot.htm"-->
<script language="JavaScript">
<!--
function checkuser()
{
if(checkspace(document.adduser.id.value)) {
document.adduser.id.focus();
alert("请输入学号!");
return false;
}
if(checkspace(document.adduser.password.value)) {
document.adduser.password.focus();
alert("请输入密码!");
return false;
}
if(checkspace(document.adduser.zhuanye.value)) {
document.adduser.zhuanye.focus();
alert("请输入专业!");
return false;
}
if(checkspace(document.adduser.xingbie.value)) {
document.adduser.xingbie.focus();
alert("请输入性别!");
return false;
}
if(checkspace(document.adduser.realname.value)) {
document.adduser.realname.focus();
alert("请输入真实姓名!");
return false;
}
return true;
}
function checkspace(checkstr) {
var str = '';
for(i = 0; i < checkstr.length; i++) {
str = str + ' ';
}
return (str == checkstr);
}
function regInput(obj, reg, inputStr)
{
var docSel = document.selection.createRange()
if (docSel.parentElement().tagName != "INPUT") return false
oSel = docSel.duplicate()
oSel.text = ""
var srcRange = obj.createTextRange()
oSel.setEndPoint("StartToStart", srcRange)
var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
return reg.test(str)
}
//-->
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -