📄 adduser.asp
字号:
<!--#include file='path.asp'-->
<%
username=request.form("userID") '接收表单信息
Password=request.form("Password")
Email=request.form("Email")
sex=request.form("sex")
company=request.form("company")
tel=request.form("tel")
add=request.form("add")
realname=request.form("realname")
userinfo=request.form("userinfo")
username=replace(username,"'","''") '将表单信息中的引号去掉
password=replace(password,"'","''")
Email=replace(Email,"'","''")
sex=replace(sex,"'","''")
tel=replace(tel,"'","''")
add=replace(add,"'","''")
realname=replace(realname,"'","''")
company=replace(company,"'","''")
userinfo=replace(userinfo,"'","''")
set rs =Server.CreateObject("ADODB.RecordSet")
sql= "SELECT * FROM [User] where username= '" & username & "'" '查询是否有同名的用户
rs.open sql,conn,1,3
if not (rs.Bof or rs.eof) then '如果有
isun="true" '标识用户名冲突
end if
If not isun="true" Then '如果没有
rs.addnew '向数据库中添加新用户
rs("username")=username
rs("userPass")=Password
rs("userEmail")=Email
rs("UserSex")=Cint(Sex)
rs("usertel")=tel
rs("useradd")=add
rs("UserCompany")=company
rs("UserInfo")=userinfo
rs("UserRealName")=realname
rs.update
End If
rs.Close()
%>
<html>
<head>
<title>注册新用户</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<LINK
href="styles.css" type=text/css rel=stylesheet>
</head>
<body>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
<tr>
<td width="100%" height="197" align="center">
<table border="0" cellspacing="0" cellpadding="0" height="85" bgcolor="#99ccff" width="100%">
<tr>
<td align="center">
<%if isun="true" then '如果用户名冲突,提示用户%>
<font color="#FF0000">该用户名已经存在,请更换注册名!!如有问题请与管理员联系。</font><br>
<a href="login.htm" class=linkblue2>返回</a>
<script>
setTimeout("location.replace('default.asp')",2000)
</script>
<%else '如果注册成功,提示用户%>
<a href="login.htm" class=linkblue2>注册成功!!点击返回主页面</a>
<script>
setTimeout("location.replace('default.asp')",2000)
</script>
<%end if%>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -