%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Dim Conn Dim RS Dim Query Dim TotalVisited Dim ImgSequence Dim CharToReplace Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "dsn=annewayne;uid=jono;pwd=jono;" Set RS = Server.CreateObject("ADODB.Recordset") Query = "SELECT * FROM Hitcounter WHERE Hit_ip='" & Request.ServerVariables("REMOTE_ADDR") & "' AND Hit_date=#" & DATE() & "#" RS.Open Query, Conn, 3, 3 'If this is the first visit from this IP IF RS.EOF AND RS.BOF THEN RS.AddNew RS("Hit_date") = Date() RS("Hit_time") = Time() RS("Hit_IP") = Request.ServerVariables("Remote_Addr") RS.Update END IF RS.Close %> <% Dim Recordset1 Dim Recordset1_numRows Set Recordset1 = Server.CreateObject("ADODB.Recordset") Recordset1.ActiveConnection = MM_Mle_STRING Recordset1.Source = "SELECT * FROM Homepage" Recordset1.CursorType = 0 Recordset1.CursorLocation = 2 Recordset1.LockType = 1 Recordset1.Open() Recordset1_numRows = 0 %> <% Dim Recordset2 Dim Recordset2_numRows Set Recordset2 = Server.CreateObject("ADODB.Recordset") Recordset2.ActiveConnection = MM_Mle_STRING Recordset2.Source = "SELECT * FROM Hitcounter" Recordset2.CursorType = 0 Recordset2.CursorLocation = 2 Recordset2.LockType = 1 Recordset2.Open() Recordset2_numRows = 0 %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim Recordset2_total Dim Recordset2_first Dim Recordset2_last ' set the record count Recordset2_total = Recordset2.RecordCount ' set the number of rows displayed on this page If (Recordset2_numRows < 0) Then Recordset2_numRows = Recordset2_total Elseif (Recordset2_numRows = 0) Then Recordset2_numRows = 1 End If ' set the first and last displayed record Recordset2_first = 1 Recordset2_last = Recordset2_first + Recordset2_numRows - 1 ' if we have the correct record count, check the other stats If (Recordset2_total <> -1) Then If (Recordset2_first > Recordset2_total) Then Recordset2_first = Recordset2_total End If If (Recordset2_last > Recordset2_total) Then Recordset2_last = Recordset2_total End If If (Recordset2_numRows > Recordset2_total) Then Recordset2_numRows = Recordset2_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (Recordset2_total = -1) Then ' count the total records by iterating through the recordset Recordset2_total=0 While (Not Recordset2.EOF) Recordset2_total = Recordset2_total + 1 Recordset2.MoveNext Wend ' reset the cursor to the beginning If (Recordset2.CursorType > 0) Then Recordset2.MoveFirst Else Recordset2.Requery End If ' set the number of rows displayed on this page If (Recordset2_numRows < 0 Or Recordset2_numRows > Recordset2_total) Then Recordset2_numRows = Recordset2_total End If ' set the first and last displayed record Recordset2_first = 1 Recordset2_last = Recordset2_first + Recordset2_numRows - 1 If (Recordset2_first > Recordset2_total) Then Recordset2_first = Recordset2_total End If If (Recordset2_last > Recordset2_total) Then Recordset2_last = Recordset2_total End If End If %> <% ' *** Validate request to log in to this site. MM_LoginAction = Request.ServerVariables("URL") If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Server.HTMLEncode(Request.QueryString) MM_valUsername=CStr(Request.Form("username")) If MM_valUsername <> "" Then MM_fldUserAuthorization="" MM_redirectLoginSuccess="Memberz/step2.asp" MM_redirectLoginFailed="default.asp" MM_flag="ADODB.Recordset" set MM_rsUser = Server.CreateObject(MM_flag) MM_rsUser.ActiveConnection = MM_Mle_STRING MM_rsUser.Source = "SELECT ID, Username, Password" If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization MM_rsUser.Source = MM_rsUser.Source & " FROM Users WHERE Username='" & Replace(MM_valUsername,"'","''") &"' AND Password='" & Replace(Request.Form("password"),"'","''") & "'" MM_rsUser.CursorType = 0 MM_rsUser.CursorLocation = 2 MM_rsUser.LockType = 3 MM_rsUser.Open If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then ' username and password match - this is a valid user 'Session("MM_Username") = MM_valUsername Session("Control")=MM_rsUser("ID") If (MM_fldUserAuthorization <> "") Then Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization).Value) Else Session("MM_UserAuthorization") = "" End If if CStr(Request.QueryString("accessdenied")) <> "" And false Then MM_redirectLoginSuccess = Request.QueryString("accessdenied") End If MM_rsUser.Close Response.Redirect(MM_redirectLoginSuccess) End If MM_rsUser.Close Response.Redirect(MM_redirectLoginFailed) End If %>
|
|||||||||||||||||||||||||
<%=(Recordset2_total)%>