<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn.asp" -->
<!--#include file="MD5.asp" -->
<%
dim admin_name,admin_pass,ip,tm
admin_name=request.Form("admin_name")
admin_pass=request.Form("admin_pass")
ip=request.Form("ip")
tm=request.Form("tm")
code=request.Form("code")
IF code<>Session("pSN") then
	call mb("验证码不正确","0","")
end if
admin_pass=md5(admin_pass)
sql="select * from admin where admin_name='"&admin_name&"'"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,3
if rs.eof then
	call mb("对不起!用户不存在","0","")
elseif admin_pass<>rs("admin_pass") then
	call mb("对不起!用户密码不正确","0","")
else
rs("loginnum")=rs("loginnum")+1
rs("loginip")=ip
rs("logintime")=tm
rs.update
session("admin_name")=admin_name
call mb("恭喜你!登陆成功","1","index.asp")
rs.close
set rs=nothing
CloseConn() 
end if
%>