Current location: Hot Scripts Forums » Programming Languages » ASP » Ip Counter


Ip Counter

Reply
  #1 (permalink)  
Old 10-31-03, 06:28 PM
Step Step is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Mexico
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Ip Counter

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
%>
Reply With Quote
  #2 (permalink)  
Old 10-31-03, 07:11 PM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
the code looks ok. are you getting any errors?

what is shown when the script is run?
Reply With Quote
  #3 (permalink)  
Old 11-01-03, 11:02 AM
Step Step is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Mexico
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
IP Counter - reply

Quote:
Originally Posted by Stealth
the code looks ok. are you getting any errors?

what is shown when the script is run?

Nothing is shown. I just see a blank page. And I don't know what could be the problem.

Thank you very much!
Reply With Quote
  #4 (permalink)  
Old 11-02-03, 06:53 AM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
ah, the all its doing is counting.

you need to access:
ipcounter.asp?Mode=Graphic and it will show the counter. simply opening ipcounter.asp will record the ip
Reply With Quote
  #5 (permalink)  
Old 11-04-03, 10:34 AM
Step Step is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Mexico
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
IP Counter

Quote:
Originally Posted by Stealth
ah, the all its doing is counting.

you need to access:
ipcounter.asp?Mode=Graphic and it will show the counter. simply opening ipcounter.asp will record the ip


Thank you very much!!!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
IP logging error in hit counter melllis ASP 2 10-02-03 06:25 PM
A different kind of image counter Stix Script Requests 1 08-11-03 11:50 PM
Hit Counter khushi Script Requests 0 07-25-03 05:00 AM
a visit counter darkcarnival General HotScripts Site Discussion 0 07-10-03 03:02 PM
i search for counter & banner ex israel-forum Script Requests 0 07-09-03 02:35 AM


All times are GMT -5. The time now is 03:49 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.