changeinfo.asp

来自「书店的管理系统。不错的一个源程序。提供给大家。」· ASP 代码 · 共 377 行

ASP
377
字号
<%@ Language=VBScript %>
<%
if Session("log_name")="" then
	Session("after_log_to")="changeinfo.asp"
	Response.Redirect ("login.htm")
else
	Session("after_log_to")=""
end if
%>
<html>

<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 3.0">
<title></title>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--

function FrontPage_Form1_onsubmit(theForm) {
  if (theForm.passwrd.value == "")
  {
    alert("请输入 \"密码\" .");
    theForm.passwrd.focus();
    return (false);
  }

  if (theForm.passwrd.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"passwrd\" field.");
    theForm.passwrd.focus();
    return (false);
  }

  if (theForm.passwrdchk.value == "")
  {
    alert("请输入 \"确认密码\" .");
    theForm.passwrdchk.focus();
    return (false);
  }

  if (theForm.passwrdchk.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"passwrdchk\" field.");
    theForm.passwrdchk.focus();
    return (false);
  }

  if (theForm.passwrdchk.value != theForm.passwrd.value)
  {
    alert("您两次输入的密码不相同 .");
    theForm.passwrdchk.focus();
    return (false);
  }

  if (theForm.passque.value == "")
  {
    alert("请输入 \"忘记密码提示问题\" .");
    theForm.passque.focus();
    return (false);
  }

  if (theForm.passque.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"passque\" field.");
    theForm.passque.focus();
    return (false);
  }

  if (theForm.passans.value == "")
  {
    alert("请输入 \"忘记密码提示答案\" .");
    theForm.passans.focus();
    return (false);
  }

  if (theForm.passans.value.length > 10)
  {
    alert("Please enter at most 10 characters in the \"passans\" field.");
    theForm.passans.focus();
    return (false);
  }

  if (theForm.name.value == "")
  {
    alert("请输入 \"真实姓名\" .");
    theForm.name.focus();
    return (false);
  }

  if (theForm.name.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"name\" field.");
    theForm.name.focus();
    return (false);
  }

  if (theForm.comaddr.value == "")
  {
    alert("请输入 \"通信地址\" .");
    theForm.comaddr.focus();
    return (false);
  }

  if (theForm.comaddr.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"comaddr\" field.");
    theForm.comaddr.focus();
    return (false);
  }

  if (theForm.zipcode.value == "")
  {
    alert("请输入 \"邮政编码\" .");
    theForm.zipcode.focus();
    return (false);
  }

  if (theForm.zipcode.value.length < 6)
  {
    alert("\"邮政编码\" 输入错误.");
    theForm.zipcode.focus();
    return (false);
  }

  if (theForm.zipcode.value.length > 6)
  {
    alert("\"邮政编码\" 输入错误.");
    theForm.zipcode.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = theForm.zipcode.value;
  var allValid = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid)
  {
    alert("\"邮政编码\" 输入错误.");
    theForm.zipcode.focus();
    return (false);
  }

  if (theForm.tel.value == "")
  {
    alert("请输入 \"联系电话\".");
    theForm.tel.focus();
    return (false);
  }

  var checkOK = "0123456789()-";
  var checkStr = theForm.tel.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("请重输 \"联系电话\".");
    theForm.tel.focus();
    return (false);
  }

  if (theForm.e_mail.value == "")
  {
    alert("请输入 \"e_mail\" .");
    theForm.e_mail.focus();
    return (false);
  }

  if (theForm.e_mail.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"e_mail\" field.");
    theForm.e_mail.focus();
    return (false);
  }

  if (theForm.othercom.value.length > 100)
  {
    alert("Please enter at most 100 characters in the \"othercom\" field.");
    theForm.othercom.focus();
    return (false);
  }
  return (true);

}

//-->
</script>
</head>

<body style="FONT-SIZE: 9pt">
<%
log_name=Session("log_name") 

set con=server.createobject("ADODB.Connection")
con.open Application("str_con")

set res=server.createobject("ADODB.Recordset")
set res.ActiveConnection = con

res.source="select name,gender,e_mail,passwrd,passque,passans,comaddr,zipcode,detaddr,othercom,tel from User_login where log_name='"&log_name&"'"
res.cursorlocation=3
res.open ,,adOpenDaynamic

if res.recordcount<1 then
	Response.Write "没有查找到您的个人信息!"
else
%>

<table width="100%" border="0" cellspacing="0">
</table>

<table width="100%" border="0">
  <tr>
    <td><table width="75%" border="0" hspace="80" align=center>
      <tr bgcolor="#FF6666">
        <td width="23%"><font color="#FFFFFF" class="unnamed2">个人注册信息</font></td>
        <td width="77%"><font color="#FFFFFF" class="unnamed2">为保障您的权益,以下带有*号信息请如实填写!</font></td>
      </tr>
    </table>
    </td>
  </tr>
</table>

<form method="POST" action="updateinfo.asp" enctype="GB2312" LANGUAGE="javascript"
onsubmit="return FrontPage_Form1_onsubmit(this)" name="FrontPage_Form1">
  <table border="0" width="75%" height="748" hspace="30" vspace="20" cellspacing="0" style="FONT-SIZE: 9pt" align=center>
    <tr>
      <td width="30%" align="right" height="39" class="unnamed1"><span
      class="unnamed1"><font color="#FF0000"><div align="left"><p>*</font>密码</span>: 
      </td>
      <td width="39%" height="39"><input type="password" name="passwrd" size="12"
      value="<%=Res("passwrd").value%>"> </td>
      <td width="43%" height="39"></td>
    </tr>
    <tr>
      <td width="18%" align="right" height="54" class="unnamed1"><span
      class="unnamed1"><font color="#FF0000"><div align="left"><p>*</font>确认密码</span>:
      </td>
      <td width="39%" height="54"><input type="password" name="passwrdchk" size="12"
      value="<%=Res("passwrd").value%>"> </td>
      <td width="43%" height="54"></td>
    </tr>
    <tr>
      <td width="18%" align="right" height="41" class="unnamed1"><font color="#FF0000" size="2"><span
      class="unnamed1"><div align="left"><p>*</span></font>忘记密码提示问题:
      </td>
      <td width="39%" height="41"><input type="text" name="passque" size="12"
      value="<%=Res("passque").value%>"> </td>
      <td width="43%" height="41" class="unnamed1">例:您的生日?</td>
    </tr>
    <tr>
      <td width="18%" align="right" height="48" class="unnamed1"><span
      class="unnamed1"><font color="#FF0000"><div align="left"><p>*</font>忘记密码提示答案</span>:
      </td>
      <td width="39%" height="48"><input type="text" name="passans" size="12"
      value="<%=Res("passans").value%>"> </td>
      <td width="43%" height="48"></td>
    </tr>
    <tr>
      <td width="18%" align="right" height="41" class="unnamed1"><span
      class="unnamed1"><font color="#FF0000"><div align="left"><p>*</font>真实姓名</span>:
      </td>
      <td width="39%" height="41"><input type="text" name="name" style="FONT-SIZE: 9pt"
      value="<%=res("name").value%>"> </td>
      <td width="43%" height="41"></td>
    </tr>
    <tr>
      <td width="18%" align="right" height="39" class="unnamed1"><font color="#FF0000"><span
      class="unnamed1"><div align="left"><p>*</span></font>性 
      别: </td>
      <td width="39%" height="39"><select name="gender" size="1"  style="FONT-SIZE: 9pt">
        <option <%if res("gender").value="男" then%> selected <%end if%> value="男">男</option>
        <option <%if res("gender").value="女" then%> selected <%end if%> value="女">女</option>
      </select> </td>
      <td width="43%" height="39"></td>
    </tr>
    <tr>
      <td width="18%" align="right" height="50" class="unnamed1"><font color="#FF0000" size="2"><span
      class="unnamed1"><div align="left"><p>*</span></font>通讯地址: 
      </td>
      <td width="39%" height="50"><input type="text" name="comaddr" style="FONT-SIZE: 9pt"
      value="<%=res("comaddr").value%>" size=40> </td>
      <td width="43%" height="50"></td>
    </tr>

    <tr>
      <td width="18%" align="right" height="52" class="unnamed1"><span
      class="unnamed1"><font color="#FF0000"><div align="left"><p>*</font>邮政编码</span>:
      </td>
      <td width="39%" height="52"><input type="text" name="zipcode" size="12"
      value="<%=Res("zipcode").value%>" maxlength=6> </td>
      <td width="43%" height="52"></td>
    </tr>

    <tr>
      <td width="18%" align="right" height="52" class="unnamed1"><span
      class="unnamed1"><font color="#FF0000"><div align="left"><p>*</font>联系电话</span>:
      </td>
      <td width="39%" height="52"><input type="text" name="tel" size="30"
      value="<%=Res("tel").value%>"> </td>
      <td width="43%" height="52"></td>
    </tr>

    <tr>
      <td width="18%" align="right" height="51" class="unnamed1"><font color="#FF0000" size="2"><span
      class="unnamed1"><div align="left"><p>*</span></font>E-MAIL:
      </td>
      <td width="39%" height="51"><input type="text" name="e_mail" size="20"
      value="<%=Res("e_mail").value%>"> </td>
      <td width="43%" height="51"></td>
    </tr>
    <tr>
      <td width="18%" align="right" height="50" class="unnamed1"><div
      align="left"><p>详细住址: </td>
      <td width="39%" height="50"><input type="text" name="detaddr" style="FONT-SIZE: 9pt"
      value="<%=Res("detaddr").value%>" size=40> </td>
      <td width="43%" height="50"></td>
    </tr>
    <tr>
      <td width="18%" align="right" height="170" class="unnamed1"><div align="left"><p>其他联系方式: </td>
      <td width="39%" height="170"><textarea rows="5" name="othercom" cols="26"><%=Res("othercom").value%></textarea> </td>
      <td width="43%" height="170" class="unnamed1">(您若不介意请留下您的电话、BP、手机号码或其他的联系方式,以便于我们发货前与您联系!)</td>
    </tr>
    <tr>
      <td width="18%" height="49"><div align="left"></div></td>
      
      <td width="39%" height="49">
		<input type="submit" name="Submit" value="提交" style="FONT-SIZE: 9pt">
		<input type="reset" value="重填" name="B1" style="FONT-SIZE: 9pt">
	  </td>
	  
      <td width="43%" height="49"></td>
      
    </tr>
  </table>
</form>

<p> </p>
<%
end if
Res.close 
con.Close
%>
</body>
</html>








⌨️ 快捷键说明

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