<!--#include file="conn.asp"-->
<!--#include file="md5.asp"-->
<%dim user,pass,qx
user=replace(trim(request("user")),"'","")
pass=md5(replace(trim(request("pass")),"'",""))
verifycode=replace(trim(request("verifycode")),"'","")
if user="" or pass="" then
response.write "<script LANGUAGE='javascript'>alert('您的用户名或密码有误！');history.go(-1);</script>"
response.end
end if
if cstr(session("getcode"))<>cstr(trim(request("verifycode"))) then
response.Write "<script LANGUAGE='javascript'>alert('请输入正确的验证码！');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from admin where user='"&user&"' and pass='"&pass&"'" 
set rs=conn.execute(sql) 
if rs.eof or rs.bof then 
response.Write("<script language=javascript>alert('帐号密码错误!');history.go(-1)</script>")  
response.End
end if
session("user")=trim(request("user"))
session("qx")=rs("qx")
response.Write "欢迎您 <font color=red>"&request.cookies("user")&"</font>"
response.redirect "index.asp"
%>
