<!--#Include File="Connection.Asp"-->
 
<!--#Include File="JaInc/Ja_MD5.Asp"-->
<%
If Cint(Trim(Request.Form("CNum")))<>Session("ChkNum") Then
Response.Write "<script language=javascript>alert('验证码错误,返回重写!');"
Response.Write "window.document.location.href='javascript:history.go(-1)';</script>"
Else
Dim Logna,LogPwd,tmprs
DIm JaCheck
Dim JaLogOK
Set JaCheck = new q_zone
Logna = JaCheck.JaKillStr(Request.Form("uid"))
LogPwd = MD5(JaCheck.JaKillStr(Request.Form("passwd")),"long")
'LogPwd=mid(LogPwd,9,16)
JaLogOK = JaCheck.JaCheckLogin(Logna,LogPwd)
Set JaCheck=Nothing

If JaLogOK = 0 Then
Response.Write "<script language=javascript>alert('用户名或密码错误,请重新填写!');"
Response.Write "window.document.location.href='javascript:history.go(-1)';</script>"
Else
set tmprs=conn.execute("select * from online where Jauid="&session("vicnum"))
if tmprs.eof and tmprs.bof then
	conn.execute("insert online values(getdate(),'"&SESSION("LoginUserName")&"',"&session("vicnum")&")")
else
	conn.execute("update online set logintime=getdate() where jauid="&session("vicnum"))
end if	
Response.Write "<script language=javascript>alert('登陆成功,欢迎你,"&Logna&"!');"
Response.Write "window.document.location.href='Index.asp?JaUid="&SESSION("VicNum")&"';</script>"
End if
End If
'Response.Write Logna & LogPwd
%>
