<%response.buffer=true%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=bbsinfo("bbsname")%></title>
<LINK 
href="css.css" type=text/css rel=stylesheet>
</head>
 
<body>
<!--#include file="top.asp"-->
<!--#include file="md5.asp"-->
<!--#include file="chkinput.asp"-->
<% 
username=Request.Cookies("esung")("username")
password=Request.Cookies("esung")("password")
if username="" or password="" then
response.redirect"login.asp"
end if
set rs=server.createobject("adodb.recordset")
    sql="select * from member  where username='" &username& "'  "
    rs.open sql,conn,1,1
    if  rs.eof then
response.write"<script language='javascript'>alert('用户名密码错误！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if
  if password<>rs("password") then
  response.write"<script language='javascript'>alert('用户名密码错误！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
response.end
end if

dim save
save=Request.Form("save")
select case save
case "save"
password=trim(replace(Request.Form("password"),chr(9),""))
email=trim(replace(Request.Form("email"),chr(9),""))
sex=replace(Request.Form("sex"),chr(9),"")
repass=replace(Request.Form("repass"),chr(9),"")
ask=trim(replace(Request.Form("ask"),chr(9),""))
anser=trim(replace(Request.Form("anser"),chr(9),""))
mingzi=trim(replace(Request.Form("mingzi"),chr(9),""))
shouji=trim(replace(Request.Form("shouji"),chr(9),""))
address=trim(replace(Request.Form("address"),chr(9),""))
aihao=trim(replace(Request.Form("aihao"),chr(9),""))
aboutme=trim(replace(Request.Form("aboutme"),chr(9),""))
qianming=trim(replace(Request.Form("qianming"),chr(9),""))
pic=trim(replace(Request.Form("pic"),chr(9),""))
oicq=trim(replace(Request.Form("oicq"),chr(9),""))
borthday=trim(replace(Request.Form("borthday"),chr(9),""))
homepage=trim(replace(Request.Form("homepage"),chr(9),""))

if 	password<> "" then	
if  strLength(password)<cint("6") or  strLength(password)>Cint("14") then
response.write"<script language='javascript'>alert('密码必须介于6到14个字符之间，且不得包含特殊符号！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
Response.End
end if
if password<>repass then
response.write"<script language='javascript'>alert('密码和确认密码不一致！')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
Response.End
end if

end if
		
if IsValidEmail(trim(request("email")))=false Then
response.write"<script language='javascript'>alert('请正确填写你的电子邮件')</script>"
response.write "<script language='javascript'>history.back(-1)</script>"
Response.End
end if
	set rs1=server.createobject("adodb.recordset")
    sql="select * from member  where username='" &username& "'  "
    rs1.open sql,conn,3,3
    if not password="" then
rs1("password")=md5(password)
end if
rs1("email")=email
rs1("sex")=sex
rs1("ask")=ask
if not anser="" then
rs1("anser")=md5(anser)
end if
rs1("mingzi")=mingzi
rs1("shouji")=shouji
rs1("address")=address
rs1("aihao")=aihao
rs1("aboutme")=aboutme
rs1("qianming")=qianming
rs1("oicq")=oicq
rs1("borthday")=borthday
rs1("homepage")=homepage   
rs1("pic")=pic
rs1.Update
 response.write"<script language='javascript'>alert('修改成功,请重新登陆！')</script>"
response.write "<script language='javascript'>window.location='login.asp'</script>"

case else
%>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="8" background="images/left.gif">&nbsp;</td>
    <td valign="top" bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
        <tr>
          <td><table width="100%" border="0" cellspacing="1" cellpadding="0">
              <tr> 
                <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr> 
                      <td height=6></td>
                    </tr>
                  </table>
                  <table width="754" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr> 
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width=6 height=6><img src="images/index_2.gif" width="6" height="6"></td>
                            <td width="742" background="images/index_3.gif"></td>
                            <td width=6> <div align="right"><img src="images/index_1.gif" width="6" height="6"></div></td>
                          </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr> 
                            <td width=1 bgcolor="C6C3C4"></td>
                            <td height=6 bgcolor="FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="8">
                                <tr> 
                                  <td><img src="images/Order_26.gif" width="10" height="10"> 
<a href="index.ASP"><%=bbsinfo("bbsname")%></a> → 修改我的资料</td>                                                                                                      
                                </tr>                                                                                                      
                              </table></td>                                                                                                      
                            <td width=1 bgcolor="C6C3C4"></td>                                                                                                      
                          </tr>                                                                                                      
                        </table>                                                                                                      
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">                                                                                                      
                          <tr>                                                                                                       
                            <td width=5 height=5><img src="images/left_data_4.gif" width="5" height="5"></td>                                                                                                      
                            <td width="742" background="images/left_data_6.gif"></td>                                                                                                      
                            <td width=5> <div align="right"><img src="images/left_data_5.gif" width="5" height="5"></div></td>                                                                                                      
                          </tr>                                                                                                      
                        </table></td>                                                                                                      
                    </tr>                                                                                                      
                  </table>                                                                                                      
                  <br>                                                                                                      
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">                                                                                                      
                    <tr>                                                                                                      
                      <td bgcolor="F4F4F4">                                                                                                      
<table width="747" height="60" border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                      
                          <tr>                                                                                                       
                            <td width="49%" valign="bottom">                               
                              <p align="left"><img src="images/reg_2.gif" width="197" height="30" align="absbottom"><font color="#FF0000">不修改的资料请留空！</font></p>                              
                            </td>                                                                                                     
                            <td width="51%" valign="top">                                                                                                      
                              <div align="right"><img src="images/reg_1.gif" width="271" height="53"></div></td>                                                                                                     
                          </tr>                                                                                                     
                        </table>                                                                                                     
                        <table width="747" border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                     
                          <tr><td>                                                                                                      
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">                                                                                                     
                                <tr>                                                                                                      
                                  <td width=109 height=10 background="images/reg_3.gif"></td>                                                                                                     
                                  <td width="628" valign="top" bgcolor="#FFFFFF">                                                                                                      
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">                                                                                                     
                                      <tr>                                                                                                      
                                        <td height=1 bgcolor="CCCCCC"></td>                                                                                                     
                                      </tr>                                                                                                     
                                    </table>                                                                                                     
                                  </td>                                                                                                     
                                  <td width=10 height=10 valign="top"> <div align="right"><img src="images/reg_4.gif" width="10" height="10"></div></td>                                                                                                     
                                </tr>                                                                                                     
                              </table>                                                                                              
                                                                                                                          
                                                                                              
                                                                                                 
                                                                                                                               
                                                                                                                                 
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">                                                                                                     
                               <form method="POST" action="myinfo.asp"  name="Form1" > <tr>                                                                                                      
                                  <input type="hidden" name="save" value="save"> <td width=1 bgcolor="C6C3C4"></td>                                                                                                     
                                  <td height=6 bgcolor="FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="5">
                                        <tr>                                                                                                      
                                        <td width="196" align="left" height="31"><div align="right">                                    
                                            <p align="center">用户名<br>                                                                                                     
                                          </div></td>                                                 
                                                                                   
                                        <td width="184" height="31">                          
                                          <p align="center">&nbsp;<strong><font color="#FF0000">                                                                                            
                                          </font></strong><strong><%=Request.Cookies("esung")("username")%></font></strong></p>                         
                                        </td>                                                                                                   
                                                                                                    
                                        <td width="185" height="31">                                   
                                          <p align="center">真实姓名</td>                                                                                                   
                                                                                                    
                                        <td width="185" height="31"><input name="mingzi" type="text" class="td1" size="20" value="<%=rs("mingzi")%>"></td>                                                                                                   
                                      </tr>                                                                                                   
                                      <tr>                                                                                                    
                                        <td width="196" align="left" height="31"><div align="right">                                   
                                            <p align="center">密码<br>                                                                                                   
                                          </div></td>                                                                                                   
                                        <td width="184" height="31"><input name="password" type="password" class="td1" size="20">                                                                                                    
                                          &nbsp; </td>                                                                                                      
                                        <td width="185" height="31">                                     
                                          <p align="center">出生日期 </td>                                                                                                      
                                        <td width="185" height="31"><input name="borthday" type="text" class="td1" size="20" value="<%=rs("borthday")%>"> </td>                                                                                                      
                                      </tr>                                                                                                      
                                      <tr>                                                                                                       
                                        <td width="196" align="left" height="31"><div align="right">                                     
                                            <p align="center">确认密码</div></td>                                                                                                      
                                        <td width="184" height="31"><input name="repass" type="password" class="td1" size="20">                                                                                                    
                                          &nbsp;                                                                                                      
                                        </td>                                                                                                     
                                        <td width="185" height="31">                                     
                                          <p align="center">联系地址                                                                                                      
                                        </td>                                                                                                     
                                        <td width="185" height="31"><input name="address" type="text" class="td1" size="20" value="<%=rs("address")%>">                                                                                                      
                                        </td>                                                                                                     
                                      </tr>                                                                                                     
                                      <tr>                                                                                                      
                                        <td width="196" align="left" height="32"><div align="right">                                     
                                            <p align="center">性别</div></td>                                                                                                     
                                        <td width="184" height="32">                         
                                        <% if rs("sex")=1 then %>                                                                                                     
                                          <input type="radio" name="sex" value="1" checked> 男孩                      
                                            <input type="radio" name="sex" value="2" >女孩                       
                                               <input name="sex" type="radio" value="3" >外星人                     
                                           <%elseif rs("sex")=2 then%>                                                          
                                          <input type="radio" name="sex" value="2" checked>女孩                       
                                           <input type="radio" name="sex" value="1" > 男孩                         
                                           <input name="sex" type="radio" value="3" >外星人                                  <%else%> 
                                          <input name="sex" type="radio" value="3" checked>外星人                     
                                          <input type="radio" name="sex" value="1" > 男孩                      
                                            <input type="radio" name="sex" value="2" >女孩  <%end if%></td>                                                                                                     
                                        <td width="185" height="32">                                                                                                        
                                          <p align="center">QQ</td>                                                                                                    
                                        <td width="185" height="32">                                                                                                       
                                          <input name="oicq" type="text" class="td1" size="20" value="<%=rs("oicq")%>"></td>                                                                                                    
                                      </tr>                                                                                                    
                                      <tr>                                                                                                     
                                        <td width="196" align="left" height="32"><div align="right">                                     
                                            <p align="center">密码问题<br>                                                                                                    
                                          </div></td>                                                                                                    
                                        <td width="184" height="32"><input name="ask" class="td1" size="20" value="<%=rs("ask")%>">                                                                                                     
                                          &nbsp;</td>                                                                                                      
                                        <td width="185" height="32">                                     
                                          <p align="center">个人主页</td>                                                                                                      
                                        <td width="185" height="32"><input name="homepage" type="text" class="td1" size="20" value="<%=rs("homepage")%>"></td>                                                                                                      
                                      </tr>                                                                                                      
                                      <tr>                                                                                                       
                                        <td width="196" align="left" height="32"><div align="right">                                     
                                            <p align="center">问题答案<br>                                                                                                      
                                          </div></td>                                                                                                      
                                        <td width="184" height="32"><input name="anser" class="td1" size="20">                                                                                                       
                                          &nbsp;</td>                                                                                                      
                                        <td width="185" height="32">                                     
                                          <p align="center">手机号码</td>                                                                                                      
                                        <td width="185" height="32"><input name="shouji" type="text" class="td1" size="20" value="<%=rs("shouji")%>"></td>                                                                                                      
                                      </tr>                                                                                                      
                                      <tr>                                                                                                       
                                        <td width="196" align="left" height="32"><div align="right">                                     
                                            <p align="center">Email地址</div></td>                                                                                                      
                                        <td width="184" height="32"> <input name="email" class="td1" size="20" value="<%=rs("email")%>"></td>                                                                                                      
                                        <td width="185" height="32">                                      
                                          <p align="center">兴趣与爱好</td>                                                                                                      
                                        <td width="185" height="32"> <input name="aihao" type="text" class="td1" size="20" value="<%=rs("aihao")%>"></td>                                                                                                      
                                      </tr>                                                                                                      
                                      <tr>                                                                                                      
                                        <td width="196" height="20">                                     
                                          <p align="center">我的头像</td>                                                                                                    
                                        <td width="184" height="20">                                                                                                    
                                          <input type="text" name="pic" value="<%=rs("pic")%>" readonly style="width:200px" class="textbox_shiixian_hui" onclick="this.readOnly=false;this.value='http://';this.focus();" size="20">                                                                                                    
                                        </td>                                                                                                    
                                        <td width="185" height="20">                                    
                                        <p align="center"><input type="button" value="选择头像" class="button" onclick="window.open('allFace.asp','','width=520,height=415,menubar=no,toolbar=no,scrollbars=yes,location=no')">                                   
                                        </td>                                                                                                   
                                        <td width="185" height="20">                                                                                                    
                                        <p align="center"><input type="button" value="自定义" class="button" onclick="this.form.pic.readOnly=false;this.form.pic.value='http://';this.form.pic.focus();">                                                                                                   
                                        </td>                                                                                                  
                                      </tr>                                                                                                 
                                      <tr>                                                                                                   
                                        <td width="196" height="62">                                  
                                          <p align="center">自我介绍</td>                                                                                                  
                                        <td width="184" height="62">                                                                                                  
                                          <textarea name="aboutme" cols="32" rows="2" class="textbox_shiixian_hui"><%=rs("aboutme")%></textarea>                                                                                                  
                                        </td>                                                                                                  
                                        <td width="185" height="62">                                  
                                          <p align="center">我的签名                                                                                                   
                                        </td>                                                                                                  
                                        <td width="185" height="62"><textarea name="qianming" cols="32" rows="2" class="textbox_shiixian_hui"><%=rs("qianming")%></textarea>                                                                                                   
                                        </td>                                                                                                  
                                      </tr>                                                                                                 
                                      <tr>                                                                                                   
                                        <td width="196" height="27"></td>                                                                                                  
                                        <td width="184" height="27">                                                                                                  
                                          <p align="center">
                                              <input type="submit" value="提交修改" name="B1" class="button">
                                            </p>                                                                                                  
                                        </td>                                                                                                  
                                        <td width="185" height="27"><input type="reset" value="全部重写" name="B2" class="button">                                                                                                   
                                        </td>                                                                                                  
                                        <td width="185" height="27">                                                                                                   
                                        </td>                                                                                                  
                                      </tr>                                                                                                 
                                    </table></td>                                                                                                  
                                  <td width=1 bgcolor="C6C3C4"></td>                                                                                                  
                                </tr>  </form>                                                                                                 
                              </table>                                                                                                  
                              <table width="100%" border="0" cellspacing="0" cellpadding="0">                                                                                                  
                                <tr>                                                                                                   
                                  <td width=10 height=10><img src="images/reg_5.gif" width="10" height="10"></td>                                                                                                  
                                  <td width="628" valign="bottom" bgcolor="#FFFFFF">                                                                                                   
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">                                                                                                  
                                      <tr>                                                                                                   
                                        <td height=1 bgcolor="CCCCCC"></td>                                                                                                  
                                      </tr>                                                                                                  
                                    </table>                                                                                                  
                                  </td>                                                                                                  
                                  <td width=123 height=10 valign="bottom" bgcolor="#FFFFFF">                                                                                                   
                                    <div align="right"><img src="images/reg_6.gif" width="123" height="10"></div></td>                                                                                                  
                                </tr>                                                                                                  
                              </table>                                                                                                                                         
                        </table>                                                                                                   
                        <table width="747" border="0" align="center" cellpadding="0" cellspacing="0">                                                                                                  
                          <tr>                                                                                                   
                            <td width="75%">                                                                                                  
<div align="right">　</div></td>                                                                                                  
                            <td width="25%" valign="top">                                                                                                   
                              <div align="right"><img src="images/reg_7.gif" width="162" height="30"></div></td>                                                                                                  
                          </tr>                                                                                                  
                        </table>                                                                                                  
                        <p>&nbsp;</p></td>                                                                                                  
                    </tr>                                                                                                  
                  </table>                                                                                                  
                                                                                                                    
                </td>                                                                                                  
              </tr>                                                                                                  
            </table></td>                                                                                                  
        </tr>                                                                                                  
      </table>       <%                                                                    
end select                                                                    
%>                                                                                            
      <!--#include file="down.asp"-->                                                                                                  
    </td>                                                                                                  
    <td width="8" background="images/right.gif">&nbsp;</td>                                                                                                  
  </tr>                                                                                                  
</table>                                                                                                  
</body>                                                                                                  
</html>                                                                                                  
    
    
