login.asp

来自「一套集网上购物和商品管理为一体的强大的网上商店(商城)系统」· ASP 代码 · 共 25 行

ASP
25
字号
<!--#include file="conn.asp" -->
<!--#include file="../md5.asp" -->
<% 
username=trim(Request.form("username"))
password=Request.form("password")
sql="select * from admin where username='"&cstr(username)&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
if rs.recordcount=0 then
  response.write "<script>alert('此用户名不存在!');</script>"
  response.write "<script>this.location.href='login.htm';</script>"
  response.end
end if
if rs("password")<>md5(trim(password)) then
   response.write "<script>alert('用户密码错误,请重新输入!');</script>"
   response.write "<script>this.location.href='login.htm';</script>"
   response.end
else
  session("username")=rs("username")
  session("xm")=rs("xm")
end if
rs.close
set rs=nothing
response.redirect "home.asp"
 %>

⌨️ 快捷键说明

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