<%PageName="UserSave"%>
<!--#include file="conn.asp"-->
<!--#include file="function.asp"-->
<!--#include file="Star.INC"-->
<%
founderr=false
if isnull(session("password")) or session("password")="" or isnull(session("username")) or session("username")="" then
	errmsg=errmsg+"<br>"+"你尚未登陆。"
	founderr=true
end if
if trim(request.form("password"))="" or Len(request.form("password"))>10 then
	errmsg=errmsg+""+"请输入您的密码(长度不能大于10)。"
	founderr=true
else
	password=trim(request.form("password"))
end if
if password<>request.form("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='"&session("username")&"' and password='"&session("password")&"'"
	rs.open sql,conn,1,3
	if rs.eof then
		errmsg="<br>"+"对不起，你不是本站用户，请重新注册。"
		founderr=true
	else
		rs("username")=session("username")
		rs("password")=password
		rs("email")=email

		if trim(request.form("Sex"))="" then
			rs("Sex")=null
		else
			rs("Sex")=trim(request.form("Sex"))
		end if
		if trim(request.form("Tel"))="" then
			rs("Tel")=null
		else
			rs("Tel")=trim(request.form("Tel"))
		end if

		if trim(request.form("Name"))="" then
			rs("Name")=null
		else
			rs("Name")=trim(request.form("Name"))
		end if

		if trim(request.form("Address"))="" then
			rs("Address")=null
		else
			rs("Address")=trim(request.form("Address"))
		end if

		if trim(request.form("huikuan"))="" then
			rs("huikuan")=null
		else
			rs("huikuan")=trim(request.form("huikuan"))
		end if

		if trim(request.form("oicq"))="" then
			rs("oicq")=null
		else
			rs("oicq")=trim(request.form("oicq"))
		end if

		rs.update
		session("password")=password
	end if
	rs.close

	if founderr=true then
		call error()
	else
%>
<!--#include file="top11.asp"-->
<div align="center">
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="200" valign="top" bgcolor="F7F7F7"><table width="100%" border="0" cellspacing="4" cellpadding="0">
        <tr> 
          <td align="center">&nbsp;</td>
        </tr>
        <!--#include file="vipleft.asp"-->
          <td align="center">&nbsp;</td>
        </tr>
      </table></td>
    <td width="576" valign="top"><table width="100%" border="0" cellspacing="3" cellpadding="0">
        <tr> 
          <td align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
              <tr> 
                <td><table width="540" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td><img src="indeximg/liebiao_bg1.gif" width="546" height="35"></td>
                    </tr>
                    <tr> 
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width="1" bgcolor="#CCCCCC"><img src="indeximg/1x1.gif" width="1" height="1"></td>
                            <td><table width="100%" border="0" cellspacing="4" cellpadding="0">
                                <tr> 
                                  <td><table border="0" cellspacing="0" cellpadding="10" align="center" width="323">
                                      <tr> 
                                        <td> <table border="0" cellspacing="0" width="502">
                                            <tr> 
                                              <td width="100%"> <div align="center"> 
                                                  <table border="0" cellpadding="4" cellspacing="1" width="502">
                                                   
                                                      <tr> 
                                                        <td width="500"  align="right"><font color="#333333">登录帐号：</font></td>
                                                        <td width="500" ><font color="#333333"><b><%=session("username")%></b></font></td>
                                                      </tr>
                                                      
                                                      <tr> 
                                                        <td width="500"  align="right"><font color="#333333">电子信箱：</font></td>
                                                        <td width="500" > <font color="#333333"> 
                                                          <b><%=Email%></b>
                                                          </font></td>
                                                      </tr>
                                                      <tr> 
                                                        <td width="500"  align="right"><font color="#333333">您的称呼：</font></td>
                                                        <td width="500" > <font color="#333333"> 
                                                          <b><%=request("Sex")%></b>
                                                          </font></td>
                                                      </tr>
                                                      <tr> 
                                                        <td width="500"  align="right"><font color="#333333">真实姓名：</font></td>
                                                        <td width="500" > <font color="#333333"> 
                                                          <b><%=request("Name")%></b>
                                                           </font></td>
                                                      </tr>
                                                      
                                                      <tr> 
                                                        <td width="500"  align="right"><font color="#333333">联系电话：</font></td>
                                                        <td width="500" > <font color="#333333"> 
                                                          <b><%=request("Tel")%></b>
                                                          </font></td>
                                                      </tr>
                                                      <tr> 
                                                        <td width="500"  align="right"><font color="#333333">详细地址：</font></td>
                                                        <td width="500" > <font color="#333333"> 
                                                          <b><%=request("Address")%></b>
                                                          </font></td>
                                                      </tr>
                                                      <tr> 
                                                        <td width="500"  align="right"><font color="#333333">汇款说明：</font></td>
                                                        <td width="500" > <font color="#333333"> 
                                                          <b><%=request("huikuan")%></b>
                                                          </font></td>
                                                      </tr>
                                                      <tr> 
                                                        <td width="500"  align="right"><font color="#333333">OICQ号码：</font></td>
                                                        <td width="500" > <font color="#333333"> 
                                                          <b><%=request("oicq")%></b>
                                                          </font></td>
                                                      </tr>
                                                      
                                                      <tr> 
      <td width="500"  align="center" colspan="2"> 
        <INPUT type=button name=back value="返 回" onclick="javascript:window.open('index.asp','_self','')">
      </td>
    </tr>
                                                    </form>
                                                  </table>
                                                </div></td>
                                            </tr>
                                          </table></td>
                                      </tr>
                                    </table></td>
                                </tr>
                              </table></td>
                            <td width="1" bgcolor="#CCCCCC"><img src="indeximg/1x1.gif" width="1" height="1"></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr> 
                      <td valign="top" bgcolor="#CCCCCC"><img src="indeximg/1x1.gif" width="1" height="1"></td>
                    </tr>
                  </table></td>
              </tr>
              <tr> 
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="Bottom1.asp"-->
<%
	end if
	set rs=nothing
end if
conn.close
set conn=nothing
%>