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

📄 modify_pass.asp

📁 实现一个用JSP、Servlet技术实现的小型物流网站系统。实现功能如下:管理员通过登录该系统
💻 ASP
字号:
<!--#include file="../head.asp"-->
 <!--#include file="../checkrole.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
   call checkuser("xm")

id=session("id")
sql="select * from wygkcn_corporation where flag=1 and  id="&id&""
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof then 
response.Redirect("../index.asp")
response.end
else
pharry=split(rs("phone"),"&nbsp;")
faarry=split(rs("fax"),"&nbsp;")
%>

<script Language="JavaScript"> 
function FormCheck() 
{ 
if (trim(document.Form1.oldpass.value) =="") 
{
alert("请填写您的旧密码!");
document.Form1.oldpass.focus();
return false; 
}
var filter=/^\s*[A-Za-z0-9]{6,20}\s*$/;
if (!filter.test(document.Form1.oldpass.value)) { 
alert("旧密码填写不正确,请重新填写!可使用的字符为(A-Z a-z 0-9 )长度不小于6个字符,不超过20个字符,注意不要使用空格。"); 
document.Form1.oldpass.focus();
document.Form1.oldpass.select();
return false; 
} 
if (trim(document.Form1.pass.value) =="") 
{
alert("请填写您的新密码!");
document.Form1.pass.focus();
return false; 
}
var filter=/^\s*[A-Za-z0-9]{6,20}\s*$/;
if (!filter.test(document.Form1.pass.value)) { 
alert("新密码填写不正确,请重新填写!可使用的字符为(A-Z a-z 0-9 )长度不小于6个字符,不超过20个字符,注意不要使用空格。"); 
document.Form1.pass.focus();
document.Form1.pass.select();
return false; 
} 
if(trim(document.Form1.confirmpassword.value) ==""){
alert("请输入您的确认密码!");
document.Form1.confirmpassword.focus();
return false;
}
if (document.Form1.pass.value!=document.Form1.confirmpassword.value ){
alert("两次填写的密码不一致,请重新填写!"); 
document.Form1.pass.focus();
document.Form1.pass.select();
return false; 
} 
if (trim(document.Form1.question.value) =="") 
{ 
alert("请选择密码提示问题!"); 
document.Form1.question.focus(); 
return (false); 
} 
if (trim(document.Form1.answer.value) =="") 
{ 
alert("请输入密码提示答案!"); 
document.Form1.answer.focus(); 
return (false); 
} 

document.Form1.submit()
}
//-->
//-->
function trim(inputString) {
	   
              if (typeof inputString != "string") { return inputString; }
              var retValue = inputString;
              var ch = retValue.substring(0, 1);
              while (ch == " ") { 
	          //检查字符串开始部分的空格
                  retValue = retValue.substring(1, retValue.length);
                  ch = retValue.substring(0, 1);
              }
              ch = retValue.substring(retValue.length-1, retValue.length);
              while (ch == " ") {
                 //检查字符串结束部分的空格
                 retValue = retValue.substring(0, retValue.length-1);
                 ch = retValue.substring(retValue.length-1, retValue.length);
              }
              while (retValue.indexOf("  ") != -1) { 
	         //将文字中间多个相连的空格变为一个空格
                 retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
              }
              return retValue;
           } 

//--> 
</script>
<TABLE width=778 border=0 align="center" cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD 
    style="BACKGROUND-POSITION: right 50%; BACKGROUND-IMAGE: url(i../mages/bg1.gif); BACKGROUND-REPEAT: repeat-y; BACKGROUND-COLOR: #ffffff" 
    vAlign=top align=middle>      <TABLE cellSpacing=0 cellPadding=0 width=100% border=0>
        <TBODY>
        <TR>
              <TD width="2%"><IMG height=32 src="../images/modifypassword.gif" width=128 
            border=0></TD>
              <TD width="98%" background="../images/info_bg.gif">&nbsp;</TD>
        </TR></TBODY></TABLE>
      <TABLE class=content_border cellSpacing=0 cellPadding=0 width=100% 
border=0>
        <TBODY>
        <TR>
          <TD align=middle>
		  
<FORM name="Form1" action="modify_pass_save.asp" method="post">
 
                  <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
                    <TBODY>
              <TR>
                <TD class=tbg3>修改密码,自设问题和自设答案</TD></TR>
              <TR>
                <TD class=tbg2>(打<FONT 
              color=#ff0000>*</FONT>为必填项)</TD></TR></TBODY></TABLE>
 
				<TABLE cellSpacing=2 cellPadding=3 width="100%" border=0>
              <COLGROUP>
              <COL 
              style="VERTICAL-ALIGN: top; PADDING-TOP: 6px; TEXT-ALIGN: right"></COLGROUP>
              <TBODY>
              <TR>
                <TD width="25%"><FONT color=#ff0000>*</FONT> <B>旧密码:</B></TD>
                <TD width="75%"><INPUT type=password maxLength=20 size=30 
                  name=oldpass> </TD></TR>
				  <TR>
                <TD><FONT color=#ff0000>*</FONT> <B>新的密码:</B></TD>
                <TD><INPUT type=password maxLength=20 size=30 name=pass> 
                  <BR>
                          <FONT class=note>6-20 个字符,只允许数字、英文字母,有大小写区分。</FONT> 
                        </TD>
                      </TR>
				<TR>
                <TD><FONT color=#ff0000>*</FONT> <B>请确认密码:</B></TD>
                <TD><INPUT type=password maxLength=20 size=30 
                  name=confirmpassword> </TD></TR>
              <TR>
                <TD><FONT color=#ff0000>*</FONT> <B>自设问题:</B></TD>
                <TD><INPUT maxLength=50 size=30 value="<%=rs("question")%>" 
                  name=question> <BR><FONT 
                  class=note>在您忘记了密码,需要找回密码的时候,会问您这个问题。比如您可以设问,“你最好的朋友的名字是什么?”</FONT> 
                </TD></TR>
              <TR>
                <TD><FONT color=#ff0000>*</FONT> <B>自设答案:</B></TD>
                <TD><INPUT maxLength=50 size=30 value="<%=rs("answer")%>" name=answer> 
                  <BR><FONT class=note>用来回答您所设定的问题。如,“阿黄”,请牢记您的答案。</FONT> 
              </TD></TR></TABLE>
			  <BR> 
            <BR>
            <TABLE cellSpacing=0 cellPadding=0 border=0 width="100%">
              <TBODY>
			  <tr><td colspan="2" bgcolor="#F3F3F3"  height="3" ></td></tr>
              <TR>
                <TD align=middle width="50%" colspan="2"><FONT size=2><INPUT type="button" value="  确 定  " onClick="FormCheck()" name=Change></FONT> 
                <FONT size=2><INPUT type=reset value=" 重 输 " name=Reset></FONT></TD></TR></TBODY></TABLE></FORM><BR>
   
            <BR><BR></TD></TR>
        </TABLE><BR><BR></TD></TR>
  </TABLE>
<%
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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