%
set my_conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open ConnString
Function ChkString(string)
ChkString = Replace(string, "'", "''")
End Function
Function ChkAdmin(strName)
ChkAdmin=0
strName = ChkString(strName)
strsql = "SELECT * from Admin"
set rsAdmin = my_conn.Execute (strsql)
if not(rsAdmin.eof or rsAdmin.bof) then
do until rsAdmin.eof
if rsAdmin("Admin_Name")=strName then ChkAdmin=1
rsAdmin.movenext
loop
end if
strsql = "select * from SFAdmin where SFAdmin_Name ='" & strName & "'"
set rsAdmin = my_conn.Execute (strSQL)
if not(rsAdmin.BOF or rsAdmin.EOF) then ChkAdmin =2
rsAdmin.close
set rsAdmin = nothing
End Function
if Request.QueryString("login")="yes" then
'set rs = server.CreateObject("ADODB.RecordSet")
Cookies_Time=Request.Form("Cookies_Time")
if Request.QueryString("Coolies_Time")<>"" then Cookies_Time=Request.QueryString("Cookies_Time")
IsUser=False
%>
<%
strSql ="SELECT M_Name, M_Password from Members where M_Name = '" & ChkString(Request.Form("UserName")) & "' and M_Password = '" & ChkString(Request.Form("Password")) &"'"
set rs = my_conn.Execute (StrSql)
if rs.BOF or rs.EOF then
IsUser=False
Else
Response.Cookies("User")("Name")= Request.Form("UserName")
Response.Cookies("User")("Pword")= Request.Form("Password")
if Cookies_Time > 0 then
Cookies_Time=dateadd("d",Cookies_Time,date())
Response.Cookies("User").expires=Cookies_Time
end if
strsql = "update online set Online_Type=" & ChkAdmin(Request.Form("UserName")) & " where Online_ip = '" & Request.ServerVariables("REMOTE_ADDR") &"'"
my_conn.Execute (strsql)
IsUser=True
End If
%>
 |
 |
|
 |
 |
| |
 |
| ::::::::济 源 职 业 技 术 学 院 精 品 课 程 ::::::: |
|
 |
 |
|