% @ language=vbscript %>
<% option explicit
response.expires=0
%>
<%
function checkuser(alias,password)
dim objRs
dim strCon
dim mypath,TorF
set objRs=server.createobject("adodb.recordset")
mypath=server.mappath("toursys.mdb")
alias=trim(alias)
strCon = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & mypath
objRs.open "select * from company_tour where alias='" & alias & "' and password='" & password & "'",strCon,1,3
if not objRs.eof then
TorF=True
else
TorF=False
end if
objRs.close
set objRs=nothing
checkuser=TorF
end function
dim alias,password,outStr,TorF,sign
alias=request("alias")
password=request("password")
if alias=empty or password=empty then
outStr="请输入用户代号及用户口令,登陆TRAINING DAY查询区."
sign=false
else
TorF=checkuser(alias,password)
if TorF then
sign=True
session("alias")=trim(alias)
session("password")=trim(password)
else
sign=False
outStr="企业代号与口令不符合!"
end if
end if
if sign=true then
response.redirect("index.htm")
else
%>