<!--#include file="Inc/Conn.asp"-->
<!--#include file="Lock.asp"-->
<!--#include file="Inc/eshopcode.asp"-->
<!--#include file="Admin/MD5.asp"-->
<%
If Request.QueryString("action")="login" Then
username=checkstr(Trim(Request.Form("username")))
pwd=MD5(Trim(Request.Form("pwd")))

sql = "Select [UserName],[PassWord] From [User] Where [UserName]='"&username&"' and [PassWord]='"&pwd&"'"
Set Rs=Conn.ExeCute(Sql)
If rs.Eof or rs.Bof Then
Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('密码或者用户名错误!');" & Chr(13)
		Response.write "window.document.location.href='Index.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
        Response.End 
Else
Dim IsC 
IsC = Conn.ExeCute("Select [IsCu] From [index] Where id=1")
If Cint(IsC("IsCu"))=1 Then
sql = "Select [UserName],[PassWord],[Check] From [User] Where [UserName]='"&username&"' and [PassWord]='"&pwd&"' and [Check]=1"
Set Rs=Conn.ExeCute(Sql)
If rs.Eof or rs.Bof Then
Response.write "<script language='javascript'>" & chr(13)
		Response.write "alert('你的用户未通过审核!');" & Chr(13)
		Response.write "window.document.location.href='Index.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
        Response.End 
Else
Session("MyUserName")=username
Session("MyPassWord")=pwd
Session.Timeout = 60
        Response.write "<script language='javascript'>" & chr(13) 
		Response.write "window.document.location.href='Index.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
        Response.End 
End if
Else
Session("MyUserName")=username
Session("MyPassWord")=pwd
Session.Timeout = 60
        Response.write "<script language='javascript'>" & chr(13) 
		Response.write "window.document.location.href='Index.asp';"&Chr(13)
		Response.write "</script>" & Chr(13)
        Response.End 
End If
End If

End if
%>