9_登录.asp

来自「ASP 网页数据库短训教程源码」· ASP 代码 · 共 41 行

ASP
41
字号
<html>
  <head><title>测试Application与Session</title></head>
  <body>
    <h3>测试Application与Session</h3>
    <hr>
<%
  '将名称存入Application之中
  '将密码存入Session之中
  user=Application("name")
  name=Request("name")
  pass=Request("pass")
  if trim(name)<>"" then
    Response.Write "嗨," & name & ","
    if trim(user)="" then 
      Application("name")=name
      Session("pass")=pass
      Response.Write "欢迎你首次访问!"
    else
      if pass=Session("pass") then
        Response.Write "欢迎你再次访问!"
      else
        Response.Write "你的密码不正确。"
      end if
    end if
    Response.write "<a href=9_登录.asp>返回</a>"
    Response.end
  end if
%>
    <form action="9_登录.asp" method="post">
    <table><tr><td>名字
               <td><input type=text name="name">
           <tr><td>密码
               <td><input type="password" name="pass">
           <tr><td><input type="Submit" Value="确定">
               <td><input type="reset" Value="重置">
    </table>
    </form>
  </body>
</html>

⌨️ 快捷键说明

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