|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How can I Track the Nummber of All Visitors, and Specific One?!
HI,
I need t track the Visitor of My Site. I mean I want to know the Number of All Visitor and the number that a Specific Visitor has Visited the Site. actually I've not so much problem with All wisitor but the Specific one! what do U believe the best solution is?! I've tried catch the User IP and handle it with that, but I've been told it's not Possible, if it's not, how can I do this, or if Yes how ?! (is it Request.ServerVariables("REMOTE_ADDR") or not?) Somebody Help PLZ!
__________________
KhoSroW. |
|
#2
|
|||
|
|||
|
This is a brief outline of what you need to do....
Create a single table called "Stats" as follows: Field Name Field Type StatID Long, AutoIncrement, Primary Key Date Date/Time Time Date/Time Path String IP String Here is code to capture and record a users visit: PHP Code:
Then you can use some SQ statements to filter the captured information. Here are the most common examples: Total Page Views SELECT COUNT(StatID) AS Total FROM Stats Page Views for a Specific Page SELECT COUNT(StatID) AS Total FROM Stats WHERE Path = '/index.asp' Page Views Grouped by Pages SELECT Path, COUNT(StatID) AS Total FROM Stats GROUP BY Path Page views for a specific time period SELECT COUNT(StatID) AS Total FROM Stats WHERE Date BETWEEN #mm/dd/yyyy# AND #mm/dd/yyyy# Visitors for a Specific Page SELECT COUNT(IP) AS Total FROM Stats WHERE Page = '/index.asp' Visitors for each Page SELECT Path, COUNT(IP) AS Total FROM Stats GROUP BY Path Visitors for a specific time period SELECT COUNT(IP) AS Total FROM Stats WHERE Date BETWEEN #mm/dd/yyyy# AND #mm/dd/yyyy# Visitors for each page for a specific time period SELECT Path, COUNT(IP) AS Total FROM Stats WHERE Date BETWEEN #mm/dd/yyyy# AND #mm/dd/yyyy# GROUP BY Path Hope that helps?? |
|
#3
|
|||
|
|||
|
Tnx alot!...
I've known some of them, but Urs is very complete! ![]() but still my question is, this line: sIP = Request.ServerVariables("remote_addr") gives back the User IP or Server IP, ... you see, I've been told that the resulk of this, is Server IP and I could not rely on that in my case (I was really believe on the person who told me, but I think he was wrong!!!) sorry of asking again, is that User IP, or Server one!? please make me Clear! Tnx. |
|
#4
|
|||
|
|||
|
It returns the Users IP Address.....not the Servers IP Address!!
|
|
#5
|
|||
|
|||
|
Tracking a user via IP could be misleading if they are behind a proxy server. Many users could share the same IP as far as you are concerned.
You could write a (encrypted) unique ID to a cookie and look for that when the user hits your site. This is also not 100% reliable though as the user could delete their cookie. Cheers |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > How can I Track the Nummber of All Visitors, and Specific One?! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|