changpassword.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:3k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../FS_Inc/Const.asp" -->
  3. <!--#include file="../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../FS_Inc/Function.asp" -->
  5. <!--#include file="../FS_Inc/Md5.asp" -->
  6. <!--#include file="../FS_Inc/Cls_Cache.asp" -->
  7. <%
  8. Dim Conn
  9. MF_Default_Conn
  10. MF_Session_TF 
  11. if not MF_Check_Pop_TF("MF024") then Err_Show
  12. if Request.Form("Action") = "Save" then
  13. Dim str_o_pass,str_n_pass,str_cn_pass,strShowErr,f_Sql,obj_Cpwd_rs
  14. str_o_pass = Request.Form("pwd")
  15. str_n_pass =  Request.Form("pwd_new")
  16. str_cn_pass =  Request.Form("Confi_pwd_new")
  17. if Trim(str_n_pass)<>Trim(str_cn_pass) then
  18. strShowErr = "<li>两次输入密码不一致</li>"
  19. Response.Redirect("Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  20. Response.end
  21. End if
  22. if str_o_pass="" or str_n_pass="" or str_cn_pass="" then
  23. strShowErr = "<li>所有的必须填写</li>"
  24. Response.Redirect("Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  25. Response.end
  26. Else
  27. Set  obj_Cpwd_rs = server.CreateObject(G_FS_RS)
  28. f_Sql = "Select Admin_Pass_Word from FS_MF_Admin Where Admin_Name='"& session("Admin_Name")&"' and Admin_Pass_Word='"& MD5(str_o_pass,16)&"'"
  29. obj_Cpwd_rs.Open f_Sql,Conn,1,3
  30. If obj_Cpwd_rs.eof then
  31. strShowErr = "<li>原密码不正确</li>"
  32. Response.Redirect("Error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  33. Response.end
  34. Else
  35. obj_Cpwd_rs("Admin_Pass_Word") = md5(str_n_pass,16)
  36. obj_Cpwd_rs.update
  37. strShowErr = "<li>密码修改成功</li>"
  38. Response.Redirect("Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=")
  39. Response.end
  40. End if
  41. End if
  42. obj_Cpwd_rs.close:set obj_Cpwd_rs = nothing
  43. End if
  44. %>
  45. <html xmlns="http://www.w3.org/1999/xhtml">
  46. <HEAD>
  47. <TITLE>FoosunCMS</TITLE>
  48. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  49. </HEAD>
  50. <script language="JavaScript" src="../FS_Inc/PublicJS.js" type="text/JavaScript"></script>
  51. <link href="images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  52. <BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 scroll=yes>
  53. <table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
  54.   <form action="" method="post" name="newadmin" id="newadmin">
  55.     <tr class="hback"> 
  56.       <td colspan="2" class="xingmu">修改密码</td>
  57.     </tr>
  58.     <tr class="hback"> 
  59.       <td width="140" align="right">管理员帐号</td>
  60.       <td> <input type="text" name="name" value="<% = session("Admin_Name")%>" size="60" readonly="true"/> 
  61.       </td>
  62.     </tr>
  63.     <tr class="hback"> 
  64.       <td width="140" height="23" align="right">原密码</td>
  65.       <td> <input type="password" name="pwd" value="" size="60" /> </td>
  66.     </tr>
  67.     <tr class="hback"> 
  68.       <td align="right"><div align="right">新密码</div></td>
  69.       <td><input name="pwd_new" type="password" id="pwd_new" value="" size="60" /></td>
  70.     </tr>
  71.     <tr class="hback"> 
  72.       <td align="right"><div align="right">确认新密码</div></td>
  73.       <td><input name="Confi_pwd_new" type="password" id="Confi_pwd_new" value="" size="60" /></td>
  74.     </tr>
  75.     <tr class="hback"> 
  76.       <td align="right">&nbsp;</td>
  77.       <td><input type="submit" name="Submit3" value=" 保存 "> <input type="reset" name="Submit4" value=" 重置 "> 
  78.         <input name="Action" type="hidden" id="Action" value="Save"></td>
  79.     </tr>
  80.   </form>
  81. </table>
  82. </body>
  83. </html>
  84. <%
  85. Conn.Close
  86. Set Conn = Nothing
  87. %>