登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

中老年人学电脑摄影博客

摄影采风、摄影作品欣赏、摄影指导、摄影教程、后期制作教程

 
 
 

日志

 
 
关于我

我从事中老年人摄影、计算机教育行业,在哈尔滨老年人大学任教,在从事摄影、计算机教育13年当中11年从事中老年人摄影、计算机教育,是国内最早从事中老年人计算机教育者之一,给我的感觉是中老人学得快,忘的快,人非常好,乐观向上。是我学习的榜样,我非常感谢中老年朋友,让我在学习和工作中得到了宝贵财富。

asp客户登录系统源代码  

2009-11-21 20:45:16|  分类: asp |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

8.4 客户登录系统源代码
Login.htm
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>客户登录</title>
</head>
<body>
<Script Language="VBScript">
<!--
Sub Checkdata()
   If Form1.Nick.Value = Empty Then
      MsgBox "登录名没有输入!",48,"注意!"
   ElseIf Form1.Password.Value = Empty Then
      MsgBox "密码没有输入!",48,"注意!"
   Else
      Form1.Submit
   End If
End Sub
-->
</Script>
<div align="center">
<table border="1" width="36%" height="159">
  <tr>
    <td width="100%" bgcolor="silver" height="36">
      <p align="center"><b>
      <font color="#000080" size="5" face="华文新魏">客户登录
      </font></b></td>
  </tr>
  <tr>
    <form name="Form1" method="POST" action="Checkuser.asp">
    <td width="100%" height="111">
      <table border="0" width="100%" height="106">
        <tr>
          <td width="39%" height="29">
            <p align="right">登录名:</td>
            <center>
          <td width="61%" height="29">
              <input type="text" name="Nick" size="15"></td>
        </tr>
        <tr>
          <td width="39%" height="29">
            <p align="right">密&nbsp; 码:</td> 
          <td width="61%" height="29">
            <input type="password" name="Password" size="15"></td>
        </tr>
        <tr>
          <td width="100%" colspan="2" height="36">
            <p align="center">
            <input type="button" value="登录" onclick="CheckData">&nbsp;  
            <input type="reset" value="重填">&nbsp;&nbsp;  
            <a href="Register.asp">注册</a></td> 
            </form> 
        </tr> 
       </table> 
      </td> 
    </tr> 
  </table> 
</div> 
</body> 
</html> 

Checkuser.asp
<%@ Language=VBScript %>
<%
Dim Nick, Password
Nick=Request.Form("Nick")
Password=Request.Form("Password")
Set Conn = Server.CreateObject("ADODB.Connection")
P1="Provider=Microsoft.Jet.OLEDB.4.0;"
Path1="Data Source="&Server.MapPath("Users.mdb")
Conn.Open P1&Path1
sql="Select Password,UserID From Users "&_
"Where Nick='"&Nick&"'"
Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open sql,Conn,0,1
If rs.BOF AND rs.EOF Then
 Response.Write "<center>登录名不存在,"&_
 "按<a href=JavaScript:history.go(-1)>这里</a>返回。"
 rs.Close
 Set rs=Nothing
 Set Conn=Nothing
 Response.End
End if
If rs("Password")<>Password Then
 Response.Write "<center>密码错误,"&_
 "按<a href=javaScript:history.go(-1)>这里</a>返回。"
 rs.Close
 Set rs=Nothing
 Set Conn=Nothing
 Response.End
End if
Session("Nick")=Nick
Session("UserID")=rs("UserID")
rs.Close
Set rs=Nothing
Set Conn=Nothing
Response.Redirect "Welcome.asp"
%>

Register.asp
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>新客户注册</title>
</head>
<body bgcolor="#CCFFFF">
<p align="center"><font color="#000080" face="华文新魏" size="6">
<b>新客户注册</b></font></p>
<form method="post" action="Checkregi.asp">
  <div align="center">
    <center>
    <table border="1" width="66%" cellspacing="1" cellpadding="0">
      <tr>
        <td width="22%" align="right" height="30">昵称: </td>
        <td width="78%">&nbsp;<input name="Nick">**</td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">密码: </td>
        <td width="78%">&nbsp;
        <input name="Password" size="20" type="password">**</td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">密码确认: </td>
        <td width="78%">&nbsp;
        <input name="rePass" size="20" type="password">**</td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">真实姓名: </td>
        <td width="78%">&nbsp;
        <input name="Name">**</td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">电子邮件:</td>
        <td width="78%">&nbsp;
        <input name="Email" size="29">**</td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">省份:</td>
        <td width="78%">&nbsp;
        <input name="Province"></td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">城市:</td>
        <td width="78%">&nbsp;
        <input name="City"></td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">详细地址:</td>
        <td width="78%">&nbsp;
        <input name="Address" size="47"></td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">邮政编码:</td>
        <td width="78%">&nbsp;
        <input name="Zip" size="12" maxlength="8" ></td>
      </tr>
      <tr>
        <td width="22%" align="right" height="30">联系电话:</td>
        <td width="78%">&nbsp;
        <input name="Phon" maxlength="16" >**</td>
      </tr>
    </table>
    </center>
  </div>
  <p align="center">
  <input type="submit" value="提交" name="B1">&nbsp;&nbsp;
  <input type="reset" value="全部重写" name="B2"></p>
</form>
<p align="center">
<font size="3">(注:有<font color="#800080">**</font>
标记的项目必须填写!)</font></p>
</body>
</html>

Checkregi.asp
<%@ Language=VBScript %>
<%
Dim Nick, Name, Password, Email
Dim Province, City, Address, Zip, Phon
Nick=Trim(Request.Form("Nick"))
Name=Trim(Request.Form("Name"))
Password=Trim(Request.Form("Password"))
rePass=Trim(Request.Form("rePass"))
Email=Trim(Request.Form("Email"))
Province=Trim(Request.Form("Province"))
City=Trim(Request.Form("City"))
Address=Trim(Request.Form("Address"))
Zip=Trim(Request.Form("Zip"))
Phon=Trim(Request.Form("Phon"))
If Nick="" OR Name="" OR Password="" OR rePass=""_
  OR Email="" OR Phon="" Then
   ShowMessage "有必填项目没有填写!"
   Set Conn=Nothing
Else
 If Password<>rePass Then
  ShowMessage "两次输入的密码不一样!"
  Set Conn=Nothing
 End If
 Set Conn = Server.CreateObject("ADODB.Connection")
 P1="Provider=Microsoft.Jet.OLEDB.4.0;"
 Path1="Data Source="&Server.MapPath("Users.mdb")
 Conn.Open P1&Path1
 Set rs = Server.CreateObject("ADODB.Recordset")
 sql="Select * From Users Where Nick='"&Nick&"'"
 rs.Open sql,Conn,0,1
 If rs.EOF AND rs.BOF Then
  sql="Insert Into Users(Nick,Password,Name,Email,"&_
   "Province,City,Address,Zip,Phon)"&_
   "Values('"&Nick&"','"&Password&"','"&Name&_
   "','"&Email&"','"&Province&"','"&City&_
   "','"&Address&"','"&Zip&"','"&Phon&"')"
  Conn.Execute sql
  rs.Close
  Set rs=Nothing
  Set Conn=Nothing
  Response.Write "<center>祝贺你注册成功!"&_
  "按<a href=Welcome.asp>这里</a>进入欢迎页面</center>"
 Else
  rs.Close
  Set rs=Nothing
  Set Conn=Nothing
  ShowMessage "此登录名已被注册!"
 End if
End if
%>
<!--显示返回重新填写信息的Sub过程:-->
<%Sub ShowMessage(msg)%>
  <body bgcolor="#ccffff">
  <center>
  <h3><%=msg%></h3>
  </center>
  <form>
  <p align="center">
  <input type=Button Value="返回重新填写" OnClick="history.back();">
  </p>
  </form>
  </body>
  <% Response.End %>
<% End Sub %>

  评论这张
 
阅读(1809)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018