check_company_login.asp
来自「oracle9i程序事例集」· ASP 代码 · 共 51 行
ASP
51 行
<%@LANGUAGE="VBSCRIPT"%>
<!-- #include file="../common/conn.asp" -->
<!-- #include file="../common/md5.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>检验公司帐号</title>
</head>
<body>
<%
if session("user_name")<>"" then
response.write "<script LANGUAGE='javascript'>alert('请先注销客户登录。');history.go(-1);</script>"
else
companyname=lcase(trim(request("companyname")))
companypw=lcase(trim(request("companypw")))
if companyname="" or companypw="" then
errmsg="公司名称和密码不能为空!"
founderr=true
else
sql="select * from scott.company_info where company_name='"&companyname&"'"
set rs=Server.CreateObject("ADODB.recordset")
rs.open sql,connstr
if rs.eof then
errmsg="您输入的公司名称或者密码有问题!"
founderr=true
else if md5(companypw)=rs("company_password") then
session("company_name")=companyname
session.Timeout=30
else
errmsg="您输入的公司名称或者密码有问题!"
founderr=true
end if
end if
rs.close
set rs=nothing
end if
if founderr=false then
response.redirect "index.asp"
else
response.write "<script LANGUAGE='javascript'>alert('"&errmsg&"');history.go(-1);</script>"
end if
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?