<%PageName="UserRegPost"%>
<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<!--#include file="Star.INC"-->
<!--#include file="style.asp"-->
<%
founderr=false

if request.form("UserName")="" or len(request.form("UserName"))>20 then
	errmsg=errmsg+""+"用户名输入错误(未输入或长度超过了20个字节)。<br>"
	founderr=true
else
	UserName=trim(request.form("UserName"))
end if
if request.form("password")="" or Len(request.form("password"))>20 then
	errmsg=errmsg+""+"请输入您的密码(长度不能大于20)。<br>"
	founderr=true
else
	password=request.form("password")
end if

if password<>request("password2") then
	errmsg=errmsg+""+"您输入的密码和确认密码不一致。"
	founderr=true
end if
if IsValidEmail(trim(request.form("Email")))=false then
	errmsg=errmsg+""+"您的Email有错误。"
	founderr=true
else
	Email=trim(request.form("Email"))
end if



if founderr=true then
	call error()
else
	set rs=server.createobject("adodb.recordset")
	sql="select * from [user] where username='"&username&"'"
	rs.open sql,conn,1,3
	if not rs.eof or username=WebName then
		errmsg=""+"对不起，您输入的用户名已经被注册，请重新输入。"
		founderr=true
	else
		rs.addnew
		rs("username")=username
		rs("password")=password
		rs("email")=email
		if request.form("Address")<>"" then rs("Address")=request.form("Address")
		if request.form("Tel")<>"" then rs("Tel")=request.form("Tel")
		if request.form("Sex")<>"" then rs("Sex")=request.form("Sex")
		if request.form("vip")<>"" then rs("vip")=request.form("vip")
		if request.form("huikuan")<>"" then rs("huikuan")=request.form("huikuan")
		if request.form("Name")<>"" and request.form("oicq")<>"" then
			rs("Name")=request("Name")
			rs("oicq")=request("oicq")
		end if
		rs("addDate")=NOW()
		rs.update
		session("UserName")=""
		session("PassWord")=""
                session("UserName")=UserName
		session("PassWord")=PassWord
		session.timeout=200
	end if
	rs.close

	if founderr=true then
		call error()
	else
%>
<%
set rs=server.createobject("adodb.recordset")
	sql="select * from [user] where username='"&session("username")&"' and password='"&session("password")&"'"
	rs.open sql,conn,1,3
if rs.eof then
	errmsg="<br>操作错误。请重新登陆！"
	call error()
	Response.end
else
	id=rs("id")
	Sex=rs("Sex")
	Email=rs("Email")
	Name=rs("Name")
	oicq=rs("oicq")
	Address=rs("Address")
	huikuan=rs("huikuan")
	Tel=rs("Tel")
        vip=rs("vip")
rs.close
end if
%>
<!--#include file="Top11.asp"-->
<body topmargin="0" leftmargin="0"> 
<div align="center">
  <center>
    <table width="770" border="0" align="center" cellpadding="0" cellspacing="4" bgcolor="#FFFFFF">
      <tr>
        <td><table width="640" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
            <tr> 
              <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td><img src="indeximg/reg_019.gif" width="640" height="81"></td>
                  </tr>
                  <tr> 
                    <td valign="top" bgcolor="#CCCCCC"><img src="indeximg/1x1.gif" width="1" height="1"></td>
                  </tr>
                  <tr> 
                    <td valign="top" bgcolor="eeeeee"><img src="indeximg/4x4.gif" width="4" height="4"></td>
                  </tr>
                  <tr> 
                    <td><table width="100%" border="0" cellspacing="1" cellpadding="4">
                        <tr> 
                          <td width="21%" height="25" bgcolor="FFEFB5"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            <font color="#FF0000">注册帐号：</font> </td>
                          <td width="79%" bgcolor="#F0F0F0"><%=Username%> </td>
                        </tr>
                        <tr> 
                          <td height="25" bgcolor="FFF7CE"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            登录密码：</td>
                          <td bgcolor="#F0F0F0"><%=password%> </td>
                        </tr>
                        <tr> 
                          <td height="25" bgcolor="FFF7CE"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            电子邮件：</td>
                          <td bgcolor="#F0F0F0"><%=email%></td>
                        </tr>
                        <tr> 
                          <td height="25" bgcolor="FFF7CE"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            会员类型：</td>
                          <td bgcolor="#F0F0F0"><%=vip%> 
                          </td>
                        </tr>
                        <tr> 
                          <td height="25" bgcolor="FFF7CE"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            您的性别：</td>
                          <td bgcolor="#F0F0F0"><%=sex%> </td>
                        </tr>
                        <tr> 
                          <td height="25" bgcolor="FFF7CE"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            真实姓名：</td>
                          <td bgcolor="#F0F0F0"> 
                            <%=Name%>
                          </td>
                        </tr>
                        <tr> 
                          <td height="25" bgcolor="FFF7CE"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            联系电话：</td>
                          <td bgcolor="#F0F0F0"> 
                            <%=Tel%>
                          </td>
                        </tr>
                        <tr> 
                          <td height="25" bgcolor="FFF7CE"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            详细地址：</td>
                          <td bgcolor="#F0F0F0"> 
                            <%=Address%>
                          </td>
                        </tr>
                       
                        </tr>
                        <tr> 
                          <td height="25" bgcolor="FFF7CE"><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                            OICQ号码：</td>
                          <td bgcolor="#F0F0F0"> 
                            <%=oicq%>
                          </td>
                        </tr>
<tr> 
                          <td height="25" bgcolor="FFF7CE" align="center"><center><img src="indeximg/ic_table01.gif" width="12" height="7" align="absmiddle"> 
                          <a href=vip.asp> 返回会员页面 </a></center>
                          </td>
                        </tr>
                      </table></td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
      </tr>
    </table>
  </center>
</div>

 <SCRIPT src="js/bottom.Js"></SCRIPT>
<%
	end if
	set rs=nothing
end if
conn.close
set conn=nothing
%>