pw2.asp

来自「同信息网站建设」· ASP 代码 · 共 88 行

ASP
88
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/conn.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("m_name") <> "") Then 
  Recordset1__MMColParam = Request.QueryString("m_name")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM members WHERE m_name = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
</head>

<body>
<% If Recordset1.EOF And Recordset1.BOF Then %>
  <p>对不起,没有该用户,请<a href="pw1.asp">返回</a>重新输入用户名。</p>
  <% End If ' end Recordset1.EOF And Recordset1.BOF %>
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
  <form id="form1" name="form1" method="post" action="pw3">
    <table width="100%" border="0" cellspacing="2" cellpadding="3">
      <tr>
        <td>您的找回密码问题是<%=(Recordset1.Fields.Item("m_question").Value)%></td>
      </tr>
      <tr>
        <td><label>您的找回密码答案是
            <input name="m_answer" type="text" id="m_answer" value="<%=(Recordset1.Fields.Item("m_pwd").Value)%>" />
        </label></td>
      </tr>
      <tr>
        <td onfocus="MM_validateForm('m_answer','','R');return document.MM_returnValue"><input name="Submit" type="submit" onclick="MM_validateForm('m_answer','','R');return document.MM_returnValue" value="提交" />
        <input name="m_name" type="hidden" id="m_name" value="<%=(Recordset1.Fields.Item("m_name").Value)%>" />
        <input name="m_question" type="hidden" id="m_question" value="<%=(Recordset1.Fields.Item("m_question").Value)%>" /></td>
      </tr>
    </table>
  </form>
  <% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
<p onfocus="MM_validateForm('m_answer','','R');return document.MM_returnValue">&nbsp;</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

⌨️ 快捷键说明

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