<%  dim  connstr
 Set conn=Server.CreateObject("ADODB.CONNECTION")
 Connstr="DRIVER={Microsoft Access Driver (*.mdb)};DBQ="+server.mappath("../db/global.asa")+";pwd=WIUS9FKEF;DefaultDir='';DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=15;SafeTransactions=0;Threads=3;UserCommitSync=Yes;" 
 conn.open connstr
 %>
<!--#include file="md5.asp"-->
<%dim username,password
username=replace(trim(request("username")),"'","")
password=Trpass(replace(trim(request("password")),"'",""))

if username="" or password="" then
response.write "<script LANGUAGE='javascript'>alert('对不起！您的用户名或密码不可以为空！');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from [user] where username='"&username&"' and passwd='"&password&"' " ,conn,1,3
if rs.bof or rs.eof then
response.write "<script LANGUAGE='javascript'>alert('对不起，您的用户名或密码有误！');history.go(-1);</script>"
else
'membername=trim(request("username"))
session("username")=rs("username")

response.Write "<font size=2>欢迎您 <font color=red size=2>"&session("username")&"</font>，两秒种后将自动跳转到相应页！</font>"
response.redirect "stock.asp"
end if
%>
