⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adduser.asp

📁 C2C二手交易网SMRUC v2.0 全部实现了C2C电子商务功能。 特别适合高校、组织、社区实现自己的C2C电子商务。 C2C二手交易网SMRUC v2.0具有强大的用户自主发布和管理信息功能
💻 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-->&nbsp;</td>
                    <td width="94"> 账号: </td>
                    <td width="60%"><input name="name" type="text" size="15" maxlength="16">
                      *账号长度&lt;=16字符</td>
                  </tr>
                  <tr> 
                    <td height="21" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
                    <td>密码: </td>
                    <td><input name="pass" type="password" size="15" maxlength="20">
                      *密码长度&lt;=20字符</td>
                  </tr>
                  <tr> 
                    <td height="26" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
                    <td>确认密码: </td>
                    <td><input name="pass2" type="password" size="15">
                      *</td>
                  </tr>
                  <tr> 
                    <td height="18" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
                    <td>E-mail: </td>
                    <td><input type="text" name="mail">
                      *</td>
                  </tr>
                  <tr> 
                    <td height="18" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</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-->&nbsp;</td>
                    <td valign="top"><!--DWLayoutEmptyCell-->&nbsp;</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 + -