userinfo.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:4k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="manage/inc/config.asp"--> 
  4. <!--#include file="inc/conn.asp"--> 
  5. <!--#include file="inc/chk.asp"--> 
  6. <%
  7. if request.cookies(cookieName)("username")="" then
  8. response.Redirect "reg.asp"
  9. response.End
  10. end if
  11. set rs=server.CreateObject("adodb.recordset")
  12. if NOT isempty(request("SaveSubmit")) then
  13. dim username
  14. username=request.cookies(cookieName)("username")
  15. rs.open "select useremail,realname,quesion,answer from [user] where username='"&username&"'",conn,1,3
  16. rs("useremail")=trim(request("useremail"))
  17. rs("realname")=trim(request("realname"))
  18. rs("quesion")=trim(request("quesion"))
  19. if trim(request("answer"))<>""then
  20. rs("answer")=md5(trim(request("answer")))
  21. end if
  22. rs.update
  23. rs.close
  24. end if
  25. rs.open "select useremail,vip,identify,quesion,realname from [user] where username='"&request.cookies(cookieName)("username")&"' ",conn,1,1
  26. 'rs.open "select useremail,vip,identify,quesion,realname from [user] where username='timesshop' ",conn,1,1
  27. Dim Rank
  28. Rank="普通会员"
  29. If rs("vip")=true then
  30. Rank = "VIP会员"
  31. End if
  32. %>
  33. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  34. <html>
  35. <head>
  36. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  37. <title>406网络书店</title>
  38. <link href="style.css" rel="stylesheet" type="text/css">
  39. </head>
  40. <body>
  41. <!--#include file="head.htm"-->
  42. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  43.   <tr>
  44.     <td width="219" align="left" valign="top"><!--#include file="uleft.asp"-->      <br></td><td width="561" align="left" valign="top">
  45.       <br>   <table border="0" cellpadding="0" cellspacing="0">
  46.         <tr>
  47.           <td><img src="images/w.gif" width="18" height="18"></td>
  48.           <td style="color:#415373">个人资料</td>
  49.         </tr>
  50.       </table>   <br>      <form name=userinfo method=post action="">
  51.         <table border=0 align=center cellpadding=3 cellspacing=3>
  52.           <tr>
  53.             <td bgcolor=#FFFFFF >用 户 名: <font color=#FF6600>
  54.               <% = request.cookies(cookieName)("username") %>
  55.             </font></td>
  56.           </tr>
  57.           <tr>
  58.             <td bgcolor=#FFFFFF >会员级别: [<b><font color=#FF6600>
  59.               <% = Rank %>
  60.             </font></b>]</td>
  61.           </tr>
  62.           <tr>
  63.             <td bgcolor=#FFFFFF >E-Mail :
  64.                 <input name=useremail type=text id=useremail value=<% =trim(rs("useremail")) %>></td>
  65.           </tr>
  66.           <tr>
  67.             <td bgcolor=#FFFFFF >真实姓名:
  68.                 <input name=realname type=text id=realname value=<% = trim(rs("realname"))%>></td>
  69.           </tr>
  70.           <tr>
  71.             <td bgcolor=#FFFFFF >密码提问:
  72.                 <input name=quesion type=text id=quesion value=<% = trim(rs("quesion"))%>>
  73.                 (用于密码遗忘时使用)</td>
  74.           </tr>
  75.           <tr>
  76.             <td bgcolor=#FFFFFF >密码答案:
  77.                 <input name=answer type=text id=answer>
  78.                 (密码遗忘时将验证此答案)</td>
  79.           </tr>
  80.           <tr>
  81.             <td height=32 align="center" bgcolor=#FFFFFF ><input name=SaveSubmit type=submit id="SaveSubmit" onClick='return checkuserinfo();' value=提交保存>
  82.               <script language="JavaScript" type="text/JavaScript">
  83. function checkuserinfo()
  84. {
  85.  if(document.userinfo.useremail.value.length!=0)
  86.   {
  87.     if (document.userinfo.useremail.value.charAt(0)=="." ||        
  88.          document.userinfo.useremail.value.charAt(0)=="@"||       
  89.          document.userinfo.useremail.value.indexOf('@', 0) == -1 || 
  90.          document.userinfo.useremail.value.indexOf('.', 0) == -1 || 
  91.          document.userinfo.useremail.value.lastIndexOf("@")==document.userinfo.useremail.value.length-1 || 
  92.          document.userinfo.useremail.value.lastIndexOf(".")==document.userinfo.useremail.value.length-1)
  93.      {
  94.       alert("Email地址格式不正确!");
  95.       document.userinfo.useremail.focus();
  96.       return false;
  97.       }
  98.    }
  99.  else
  100.   {
  101.    alert("Email不能为空!");
  102.    document.userinfo.useremail.focus();
  103.    return false;
  104.    }
  105. }
  106.               
  107. </script>
  108.   <%
  109. rs.close
  110. set rs=nothing
  111. %></td>
  112.           </tr>
  113.         </table>
  114.       </form></td>
  115.   </tr>
  116. </table>
  117. <!--#include file="foot.htm"-->
  118. </body>
  119. </html>