Well - heres what I do:
Make a new file called logstuff.php (or whatever you want) and include this as the very first line of all your pages.
Next decide what you want logged (I'll use IP, login_name, page, time for this example - but add anything you want) and create a table with all these fields.
Then in logstuff.php just have it do a mysql_query(INSERT INTO log VALUES ('$ip','$login_name','$page')
So each page will look like this:
<?php
include("logstuff.php");
.......
And logstuff will look like this:
<?php
$page = $_SERVER['REQUEST_URI'];
$ip = ; //forgot this one - will get back to you with it later
$login_name = ; //value from cookie for login system
if ($login_name == "")
$login_name = "Visitor";
mysql_query(INSERT INTO log VALUES ('$ip','$login_name','$page');
?>
If you set the time field in the database to the correct format (TIMEDATE I think its called) then it sets a timestamp for you 🙂
For the summary page simple request the data from the DB and also use COUNT() to see the number of times a page has been visited......
Hope that helps
- Matt