<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%dim action,username
action=request.QueryString("action")
username=request.Cookies("bookshop")("username")
select case action
'//收货人信息
case "shouhuoxx"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [user] where username='"&username&"' ",conn,1,3
rs("shouname")=trim(request("shouname"))
rs("shengshi")=trim(request("shengshi"))
rs("shouhuodizhi")=trim(request("shouhuodizhi"))
rs("youbian")=cstr(request("youbian"))
rs("usertel")=trim(request("usertel"))
rs("songhuofangshi")=int(request("songhuofangshi"))
rs("zhifufangshi")=int(request("zhifufangshi"))
rs("shousex")=int(request("shousex"))
rs.Update
rs.Close
set rs=nothing
response.Write "<script language=javascript>alert('您的收货信息保存成功！');history.go(-1);</script>"
response.End
'//用户资料
case "userziliao"
set rs=server.CreateObject("adodb.recordset")
rs.open "select useremail,userzhenshiname,quesion,answer from [user] where username='"&username&"'",conn,1,3
rs("useremail")=trim(request("useremail"))
rs("userzhenshiname")=trim(request("userzhenshiname"))
rs("quesion")=trim(request("quesion"))
if trim(request("answer"))<>""then
rs("answer")=md5(trim(request("answer")))
end if
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('您的个人资料修改成功！');history.go(-1);</script>"
case "savepass"
set rs=server.CreateObject("adodb.recordset")
rs.open "select userpassword from [user] where username='"&username&"'",conn,1,3
if md5(trim(request("userpassword")))<>trim(rs("userpassword")) then
response.Write "<script language=javascript>alert('对不起，您输入的原密码错误！');history.go(-1);</script>"
response.End
else
rs("userpassword")=md5(trim(request("userpassword1")))
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('密码更改成功！');history.go(-1);</script>"
response.End
end if
'//取回密码
case "repass"
set rs=server.CreateObject("adodb.recordset")
rs.open "select userpassword from [user] where username='"&trim(request("username2"))&"'",conn,1,3
rs("userpassword")=md5(trim(request("userpassword2")))
rs.update
rs.close
set rs=nothing
response.Write "<script language=javascript>alert('您的密码取回成功，请登陆！');history.go(-1);</script>"
end select
conn.close
set conn=nothing
%>