Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Tracking visitors


adammc - 9:49 am on Mar 3, 2008 (gmt 0)


Hi guys,

I would like to create a script that logs the following so I can track 'unique' visitors to each product page on my online store. I assume I would use unique IP to determine this?

id - auto inc
page name - data generated from products page
visitor ip -
date / time of visit

I assume i need to do something like this:

// Check if visitor is already in the table for the certain page
$ipaddress = $_SERVER['REMOTE_ADDR'];
$visit_date = time();
$result = mysql_query("SELECT * FROM tracking WHERE ipaddress = '$ipaddress' AND pagename='$somepagename'");

How would I perform the rest of the query?
Also it would be nice to allow a visitor to appear in the table again as a unique if he revisits after 1 week, is that possible?

Any help would be greatly appreciated


Thread source:: http://www.webmasterworld.com/php/3589737.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com