www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > reg.asp

    <!--#include file="admin/config.asp"-->
<%
if request("type")="save" then
if webreg<>"1" then
response.write("<script>alert('错误:暂停注册新帐号!');history.go(-1)</script>")
response.end
end if
server_vv=len(Request.ServerVariables("SERVER_NAME"))
server_v1=left(Cstr(Request.ServerVariables("HTTP_REFERER")),server_vv)
server_v2=left(Cstr("http://"&Request.ServerVariables("SERVER_NAME")),server_vv)
if server_v1<>server_v2 and server_v1<>"" and server_v2<>"" then
response.write("<script>alert('错误:禁止从站点外部提交数据!.')</script>")
response.end
end if

if request.form("user")="" or request.form("pwd1")="" or request.form("pwd2")="" or request.form("email")="" then
response.write("<script>alert('错误:带*号的不能为空!');history.go(-1)</script>")
response.end
end if

if request.form("pwd1")<>request.form("pwd2") then
response.write("<script>alert('错误:两次输入密码不相同!');history.go(-1)</script>")
response.end
end if
%>
<!--#include file="conn1.asp"-->
<!--#include file="admin/char.inc"-->
<%
set rs=server.CreateObject("ADODB.RecordSet")
rs.open "select * from UserInfo where user='"&request("user")&"'",conn,1,1
if not rs.eof then
rs.close
set rs=nothing  
conn.close  
set conn=nothing
response.write("<script>alert('错误:用户名已存在,请改名!');history.go(-1)</script>")
response.end
end if
rs.close
%>

<!--#include file="admin/MD5.asp"-->
<%
passwd1=md5(trim(checkStr(request.form("pwd1"))))
rs.open "select * from UserInfo where (id is null)",conn,1,3
rs.addnew
  rs("user")=trim(request("user"))
  rs("pwd")=passwd1
  rs("sex")=request("sex")
  rs("oicq")=htmlencode(trim(request("oicq")))
  rs("email")=htmlencode(trim(request("email")))
  if webreglock="1" then
    rs("lock")=1
    mgs="默认新注册帐号为锁定状态!"
  end if
rs.update
rs.close
set rs=nothing  
conn.close  
set conn=nothing
response.write("<script>alert('成功:注册帐号完成,请点击确定进入登陆页面!("&mgs&")');location.href='admin/login.asp'</script>")
response.end
end if
%>
<html>

<head>
<title>用户注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="ADMIN/admin.css" type="text/css">
</head>
<body bgcolor="#CCCCCC" leftmargin="0" topmargin="0">
<%if webreg<>"1" then%>
<table border="0" cellspacing="0" style="border-collapse: collapse" width="100%" cellpadding="0" height="140">
  <tr>
    <td width="100%" height="140">
    <p align="center">对不起,暂不开放新用户注册!</td>
  </tr>
</table>
<%else%><form action="reg.asp" method="post">
<input type="hidden"  name="type" value="save">
<div align="center">
  <br>
    <table border="0" class="tableBorder" cellspacing="1" style="border-collapse: collapse" width="500">
      <tr>
        <th width="697" height="23" bgcolor="#CCCCCC"> <b>新 用 户 注 册 [2ky.Cn]</b></th>
    </tr>
    <tr>
      <td width="100%" bgcolor="#FFFFFF">      
       用户名:<input name="user" size="15" style="border-style: solid; border-width: 1">
          <font color="#FF0000">*</font><font color="#808080">&nbsp; </font></td>     
    </tr>     
    <tr>     
      <td width="100%" bgcolor="#FFFFFF">           
      登陆密码:<input name="pwd1" size="15" style="border-style: solid; border-width: 1" type="password">
          <font color="#FF0000">*</font><font color="#808080">&nbsp; </font></td>     
    </tr>     
    <tr>     
      <td width="100%" bgcolor="#FFFFFF">           
      确认密码:<input name="pwd2" size="15" style="border-style: solid; border-width: 1" type="password">
          <font color="#FF0000">*</font><font color="#808080">&nbsp; 
          </font></td>     
    </tr>     
    <tr>     
      <td width="100%" bgcolor="#FFFFFF">           
        性别:<select size="1" name="sex">
            <option value="男" selected>男</option>
            <option value="女">女</option>
          </select></td>     
    </tr>     
    <tr>     
      <td width="100%" bgcolor="#FFFFFF">           
        OICQ:<input name="oicq" size="15" style="border-style: solid; border-width: 1">
          <font color="#FF0000">*</font></td>
    </tr>
    <tr>
      <td width="100%" bgcolor="#FFFFFF">      
       E-Mail:<input name="email" size="32" style="border-style: solid; border-width: 1">
          <font color="#FF0000">* </font>[本站承诺决不泄露]</td>     
    </tr>     
    <tr>     
        <th width="697" height="23"> 
          <p align="center"> 
            <input name="b1" type="submit" value="提 交 信 息">
            &nbsp;           
            <input name="b2" type="reset" value="清 空">
          </p>     
     </th>          
    </tr>     
  </table>     
  </center>     
</div>     
</form>     
<%end if%><br>    
 
</body>   
</html>