📄 adduser.asp
字号:
<%
if session("admin_name")="" then
response.write "<script LANGUAGE='javascript'>alert('对不起,登陆超时!');</script>"
response.end
end if
%>
<!-- #include file="conn.asp" -->
<!-- #include file= "../function.asp" -->
<!-- #include file= "../MD5.asp" -->
<html>
<head>
<link href="../css.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>中国人民大学二手交易网-添加用户</title></head>
<%
action=request.QueryString("action")
if action="save" then
name=ReplaceBadChar(request("name"))
pass=ReplaceBadChar(request("pass"))
pass2=ReplaceBadChar(request("pass2"))
mail=request("mail")
qq=ReplaceBadChar(request("qq"))
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
set rs=server.createobject("adodb.recordset")
sql="select * from [user] where user_name='"&name&"'"
rs.open sql,conn,1,1
if name="" or pass="" or pass2="" or mail="" then
message="注册失败,请您填写完整!"
elseif pass<>pass2 then
message="注册失败,两次密码不相同!"
elseif isvalidemail(trim(mail))=false then
message="注册失败,您的E-mail不合法!"
elseif not rs.eof then
message="注册失败,该帐号已经存在!请您选择其他账号!"
rs.close
else
sql="insert into [user](user_name,user_pass,user_mail,user_qq,user_ip,user_lastlogintime) values('"&name&"','"&Md5(pass2)&"','"&mail&"','"&qq&"','"&userip&"','"&now()&"') "
conn.execute(sql)
sql="update config set user_count=user_count+1"
conn.execute(sql)
session("user")=name
response.write "<script LANGUAGE='javascript'>alert('添加成功!');location.replace('adduser.asp');</script>"
end if
end if
%>
<body>
<div align="center">
<p><font color="#FF0000"><%=message%></font></p><table width="39%" border="0" cellpadding="1" cellspacing="1" bgcolor="#66CCFF">
<tr>
<td height="24" valign="middle" bgcolor="#00FFFF"> <div align="center">添加用户</div></td>
</tr>
<tr>
<td height="148" valign="top" bgcolor="#FFFFFF"><form method="post" action="adduser.asp?action=save">
<table width="382" height="146" border="0">
<!--DWLayoutTable-->
<tr>
<td width="49" height="24" valign="top"><!--DWLayoutEmptyCell--> </td>
<td width="94"> 账号: </td>
<td width="60%"><input name="name" type="text" size="15" maxlength="16">
*账号长度<=16字符</td>
</tr>
<tr>
<td height="21" valign="top"><!--DWLayoutEmptyCell--> </td>
<td>密码: </td>
<td><input name="pass" type="password" size="15" maxlength="20">
*密码长度<=20字符</td>
</tr>
<tr>
<td height="26" valign="top"><!--DWLayoutEmptyCell--> </td>
<td>确认密码: </td>
<td><input name="pass2" type="password" size="15">
*</td>
</tr>
<tr>
<td height="18" valign="top"><!--DWLayoutEmptyCell--> </td>
<td>E-mail: </td>
<td><input type="text" name="mail">
*</td>
</tr>
<tr>
<td height="18" valign="top"><!--DWLayoutEmptyCell--> </td>
<td>QQ: </td>
<td><input name="qq" type="text" onkeyup="value=value.replace(/[^\d]/g,'') " size="15" maxlength="15"onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"></td>
</tr>
<tr>
<td height="25" valign="top"><!--DWLayoutEmptyCell--> </td>
<td valign="top"><!--DWLayoutEmptyCell--> </td>
<td><input type="submit" name="Submit" value="提交"></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -