Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - IP Counter
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

IP Counter

 Post Reply Post Reply
Author
Step View Drop Down
Newbie
Newbie


Joined: 13 August 2003
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Step Quote  Post ReplyReply Direct Link To This Post Topic: IP Counter
    Posted: 31 October 2003 at 5:38pm

Hello everybody.

Does anyone know why this code doesn't work well?
It is sending data to my .mdb file, that is not the problem.
But is doesn't display data on the page. I want to display the number of visitors with graphics.
Thank you very much!!!

 

<%
  Dim Conn
  Dim RS
  Dim TotalVisited
  Dim ImgSequence
  Dim CharToReplace
  Dim Query

  Set Conn = Server.CreateObject("ADODB.Connection")
  Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("hit_counter.mdb")

  Set RS = Server.CreateObject("ADODB.Recordset")

  Query = "SELECT * FROM Hits WHERE Hit_IP='" & Request.ServerVariables("REMOTE_ADDR") & "' AND Hit_Date=#" & DATE() & "#"
  RS.Open Query, Conn, 3, 3

  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

  Select Case Request.QueryString ("Mode")


  Case "Graphic"

    RS.Open "SELECT COUNT (*) AS TotalVisits FROM Hits", conn, 3, 3

    If Not RS.Eof and NOT RS.Bof Then

      TotalVisits = Rs("TotalVisits")
      RS.Close

      For I = 1 to Len (TotalVisits)

        CharToReplace = Mid(TotalVisits, I, 1)
        ImgSequence = ImgSequence & "<img src='" & CharToReplace & ".gif' Border=0>" 

      Next

      Response.Write ImgSequence

    Else

       Response.Write "<img src='0.gif' border=0>"

    End If

  End Select
%>

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 04 November 2003 at 10:59am

Well your not giving us the error so i assume there wasnt one

Try changing

IF RS.EOF AND RS.BOF THEN

To

If Not RS.Eof Then

Mart.

Back to Top
Step View Drop Down
Newbie
Newbie


Joined: 13 August 2003
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote Step Quote  Post ReplyReply Direct Link To This Post Posted: 04 November 2003 at 11:09am

You're right, I have no error message, I just see a blank page.

I'll try to do what you're saying. Thank you very much!!!

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.