⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 change.asp

📁 针对网上商城批发零售销售特点开发的综合商城系统,既适合商城零售VIP会员特点,又适合批发商城批发商等级价格体系,同时三种价格体系能更精确调整价格和优惠价格定义
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录!');history.go(-1);</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录!');history.go(-1);</script>"
response.End
end if
end if
%>
<title>修改密码</title>
<%if FormatSQL(SafeRequest("action",0))="save" then%>
<!--#include file="../func.asp"-->
<%if session("rank")=3 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权更改密码!');history.go(-1);</script>"
response.End
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from admin where admin='"&session("admin")&"'",conn,1,3
if md5(trim(request.form("UserPassword")))<>rs("UserPassword") then
response.Write "<script language=javascript>alert('原密码错误,请返回重新输入');history.go(-1);</script>"
response.End
else
rs("UserPassword")=md5(trim(request.form("UserPassword2")))
rs.Update
rs.Close
set rs=nothing
session("admin")=""
session("rank")=""
response.Write "<script language=javascript>alert('修改成功,请用新密码重新登录!');history.go(-1);</script>"
end if
response.End
end if
%>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" BGCOLOR="#338FCC">
  <tr> 
    <td height="20" BGCOLOR="#338FCC" align="center"><font color="#FFFFFF">更改管理密码</font></td>
  </tr>
  <tr> 
    <td height="163" bgcolor="#FFFFFF"> 
	<table width="200" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
        <form name="renUserPassword" method="post" action="change.asp?action=save">
          <tr bgcolor="#FFFFFF"> 
            <td width="100">用户名:</td>
            <td width="150" align="center"><font color=red><%=session("admin")%></font></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td>原密码:</div></td>
            <td align="center"><input name="UserPassword" type="Password" id="UserPassword" size="12"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td>新密码:</div></td>
            <td align="center"><input name="UserPassword1" type="Password" id="UserPassword1" size="12"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td>确认密码:</td>
            <td align="center"><input  name="UserPassword2" type="Password" id="UserPassword2" size="12"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2" align="center"><input onClick="return check();" type="submit" name="Submit" value="确定更改"></td>
          </tr>
        </form>
      </table></td>
  </tr>
</table>
<br>
<!--#include file="footer.asp"-->
<script LANGUAGE="javascript">
<!--
function checkspace(checkstr) {
  var str = '';
  for(i = 0; i < checkstr.length; i++) {
    str = str + ' ';
  }
  return (str == checkstr);
}
function check()
{
  if(checkspace(document.renUserPassword.UserPassword.value)) {
	document.renUserPassword.UserPassword.focus();
    alert("原密码不能为空!");
	return false;
  }
  if(checkspace(document.renUserPassword.UserPassword1.value)) {
	document.renUserPassword.UserPassword1.focus();
    alert("新密码不能为空!");
	return false;
  }
    if(checkspace(document.renUserPassword.UserPassword2.value)) {
	document.renUserPassword.UserPassword2.focus();
    alert("确认密码不能为空!");
	return false;
  }
    if(document.renUserPassword.UserPassword1.value != document.renUserPassword.UserPassword2.value) {
	document.renUserPassword.UserPassword1.focus();
	document.renUserPassword.UserPassword1.value = '';
	document.renUserPassword.UserPassword2.value = '';
    alert("新密码和确认密码不相同,请重新输入");
	return false;
  }
	document.admininfo.submit();
  }
//-->
</script> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -