ASP+ACCESS网上招聘网站开发+ER图+用例图(22)
时间:2017-02-12 16:32 来源:毕业论文 作者:毕业论文 点击:次
企业和个人都可以在点击左侧的修改账号密码来进行密码的修改,修改密码界面如下: 图6.10 修改密码界面 代码如下: <!--#include file="../inc/conn.asp"--> <!--#include file="../top.asp"--> <!--#include file="Checklogin.asp"--> <!--#include file="topmenu.asp"--> <!--#include file="../inc/md5.asp"--> <SCRIPT language=javascript src="/inc/ComFunc.js"></SCRIPT> <SCRIPT language="javascript"> <!-- function del_space(s) { for(i=0;i<s.length;++i) { if(s.charAt(i)!=" ") break; } for(j=s.length-1;j>=0;--j) { if(s.charAt(j)!=" ") break; } return s.substring(i,++j); } function VerifySubmit() { password = del_space(document.newreg.password.value); if (password.length == 0) { alert("请填写旧密码!"); document.newreg.password.select(); return false; } newpass = del_space(document.newreg.newpass.value); if (newpass.length == 0) { alert("请填写新密码!"); document.newreg.newpass.select(); return false; } if (document.newreg.newpass.value.length<4 || document.newreg.newpass.value.length>20 || !isStr(document.newreg.newpass.value)){ alert("密码的长度必须在4-20之间的字符或数字!"); document.newreg.newpass.select(); return false; } renewpass = del_space(document.newreg.renewpass.value); if (renewpass.length == 0) { alert("请填写新密码确认!"); document.newreg.renewpass.select(); return false; } renewpass = del_space(document.newreg.renewpass.value); if (newpass!=renewpass) { alert("新密码和新密码确认不相同,请重新填写!"); document.newreg.renewpass.select(); return false; } return true; } //--> </SCRIPT> <% if request("oper")="edit" then dim password,newpass,oldpassword password=md5(request.Form("password"),16) newpass=md5(request.Form("newpass"),16) set rs=conn.execute("select password from User_login where id='"&session("user_id")&"'") oldpassword=rs("password") rs.close if password<>oldpassword then%> <script language="JavaScript"> (责任编辑:qin) |