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

📄 sale1.asp

📁 数据库课程设计
💻 ASP
字号:
<%@ LANGUAGE="VBScript" %>
<script language="vbscript" src="details.vbs"></script>
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
<body bgcolor="#CCCC33">
<form name="flog" action="sale1.asp" method="post">
<font size="5" face="楷体_GB2312"><b>在线购书</b></font>
| <a href="#" onClick="parent.location='index.asp'">本店主页</a>
| <a href="#">在线竞买</a>
| <a href="#">用户投票</a>
| <a href="#">问卷调查</a>
| <a href="#">站点管理</a>
| <a href="mailto:hbzqiang@163.com" target="_blank">联系我们</a> |
<hr>
<table bgcolor="#CCFFCC">
<tr>
<% ' 注释:如果有传递参数表示用户在进行登录操作
   If Request("userid") <> "" And Request("pass") <> "" Then
   ' 注释:生成用户信息表查询语句并连接数据库进行查询
	  mysql = "SELECT id, rank FROM customer " & _
               "WHERE id = '" & Request("userid") & "'" & _
                 "AND pass = '" & Request("pass") & "'"
      Set objRS = Session("objRS")
      objRS.Source = mysql
      objRS.Open
   ' 注释:读取检索到的用户信息
      If objRS.RecordCount > 0 Then	' 登录成功
         Session("userid") = objRS("id")
         Session("rank") = objRS("rank")
         ermsg = ""
      Else	' 登录失败
         Session("userid") = ""
         Session("rank") = ""
         ermsg = "<font color=red>[会员名]或者[密码]不正确!登录失败...</font>"
      End If
   ' 注释:关闭记录集对象
      objRS.Close
      Set objRS = Nothing
   Else
      Session("userid") = ""
      Session("rank") = ""
   End If
' 注释:获取当前用户的身份信息
   If Session("userid") <> "" Then
      If Session("rank") = 1 Then
         msg = "普通会员"
      Else
         msg = "VIP会员"
      End If
   Else
      msg = ""
   End If
' 注释:显示当前用户信息
   If msg = "" Then	' 没有登录的用户
%>
      <td>会员名</td>
      <td><input name="userid" type="text" maxlength="15" size="10">&nbsp;</td>
      <td>密码</td>
      <td><input name="pass" type="password" maxlength="15" size="10">&nbsp;</td>
      <td><input name="login" type="button" value="登录"></td>
      <td><input name="register" type="button" value="注册"></td>
<% Else	' 成功登录的用户
      Response.Write("<th>" & msg & "[" & Session("userid") & "]&nbsp;</th>") %>
      <td><input name="logout" type="submit" value="登出"></td>
      <td><input name="reginfo" type="button" value="个人资料"></td>
<% End If %>
   <td><input name="history" type="button" value="购书记录"></td>
   <td><input name="pay" type="button" value="结算"></td>
   <td><input name="clear" type="button" value="清空购物袋"></td>
   <td><% =ermsg %></td>
</tr>
</table>
</form>
</body>
</html>

⌨️ 快捷键说明

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