home *** CD-ROM | disk | FTP | other *** search
/ 221.214.14.186 / 221.214.14.186.tar / 221.214.14.186 / dz / yc / data / admins.inc.asp next >
Text File  |  2003-09-04  |  870b  |  30 lines

  1. <%
  2. function check(username,password)
  3.     dim con , sql,rs
  4.     set con=server.CreateObject("ADODB.connection")
  5.     con.open constr
  6.     sql="select * from  TAdmins where username='" & userName & "'" 
  7.     set rs=con.execute (sql)
  8.     if not rs.eof then
  9.         if rs("password")=password then
  10.             session("AdminsID")=rs("AdminsID")
  11.             session("power")=rs("power")
  12.             session("homepage")=rs("homepage")
  13.             check=rs("power")
  14.             'session("username")=username
  15.             'session("password")=password
  16.             session("allname")=rs("allname")
  17.             session("lastDate")=rs("lastDate")
  18.             session("counts")=rs("counts")
  19.             sql="update TAdmins set counts=counts+1 ,lastdate='"& Now() &"'"
  20.             sql=sql & ",hostip='"& Request.ServerVariables("REMOTE_ADDR") &"' where AdminsID=" & session("AdminsID")
  21.             con.execute sql
  22.         else
  23.             check=0
  24.         end if
  25.     else
  26.         check=0
  27.     end if
  28.     con.close
  29. end function
  30. %>