user.asp

来自「BBS源代码网上到处都是, 实现语言也不尽相同, 本人上传的BBSExample」· ASP 代码 · 共 47 行

ASP
47
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#Include file="odbc_conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
  dim sname,password,sql,rs,sql3,rs2
  sname=request.Form("sname")
  session("name")=request.Form("sname")
  password=request.Form("password")
  if sname="小珍" and password="2146718" then 
    response.Redirect "admin.asp"
  else
  if sname="" then
   response.Write "姓名不能为空!"
   response.End()
  else if password=""  then
   response.Write "请输入您的密码!"
   response.End()
  else  sql3="select * from users where  name='"&sname&"'"
  set rs=server.CreateObject("adodb.recordset")
  rs.open sql3,conn,1
  if rs.recordcount="" then
  response.Write "对不起,不存在该用户,想要注册吗?"
  response.End()
  else
  sql="select password from users where name='"&sname&"'"
  'response.Write sql
  'response.End()
  set rs2=server.CreateObject("adodb.recordset")
  rs2.open sql,conn,1
  ' set rs=conn.execute(sql)
  if rs("password")<>password  then
  response.Write "对不起,您输入的密码不正确!"
  response.End()
  end if
  end if
  end if
  end  if 
  end if
  response.Redirect "first.asp"
%>
</body>
</html>

⌨️ 快捷键说明

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