> Can one write a small script to track how many unique addresses
> access a site? And if so, any ideas how that might be done?
Easy. Create a db table with IP address and hitcounter, something like:
table: visitors_ips
fields: vi_id, vi_ip, vi_hits
Beginning of every pageload, do a check (see later) using session,
let's say:
if (not isset($_SESSION["vi_id"])) {register;}
where register does the following:
get the IP address for the page request.
see if this is in the table (SELECT * FROM visitor_ips where IP="...")
if a row found: update this row with the value hits incremented by one.
if no row found: insert a new row with vi_hits set to one
set the session variable to the value selected above to avoid double
counting.
However, IP addresses give little information, as IP addresses can be
assigned dynamically. I usually store sub level domain names.
(get the IP, resolve the machine name, to something like "183-
adsl.cpece.brasiltelecom.br", $temp = explode(".", $machinename),
combine the last to elements of this array to the sublevel domain, and
store this with a counter).
Much more informative than plain unique IP numbers.
Marc
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/