<%
Dim name,pwd
Name=trim (Request ("name"))
Pwd=trim (Request ("pwd"))
If Name= "" or pwd= "then
Response. Write "<script>alert (' account password cannot be empty! '); location= ' manage/main.asp ' </script> "
Else
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from admin where name= '" &name& "'"
Rs.Open sql,conn,1,1
If not rs.eof then
If Pwd=rs ("pwd") Then
Session ("mm_username") = ""
Session ("Mm_username") =rs ("name")
Session ("QX") =rs ("QX")
Response. Write "<script>alert (' landing success '); location= ' manage/main.asp ' </script>"
Else
Response.Write "<script language= ' JavaScript ' >window.confirm (' account number and password is incorrect, please return to refill! ');p arent.window.history.go ( -1);</script> "
End If
Else
Response.Write "<script language= ' JavaScript ' >window.confirm (' username is incorrect, please return to refill! ');p arent.window.history.go ( -1);</script> "
End If
End If
%>
ASP login check and login detection