This script is intended to be include()d at the end of a page, just before the tag. It appends a footer stating your name, the number of hits to the page, the time of the last hit and the date when the page was last updated. It also creates a link to the W3C HTML validator, so you are always only one click away from validating any page on your site.
To use my script, you'll need to create a php3 database using the command "msqladmin create php3". (No quotes.) then create a table with the following commands:
CREATE TABLE log (
CREATE UNIQUE INDEX idx ON log(fname)
As you can see, this is a much more spare form of access logging than that built into PHP/FI, recording only the page name, the amount of times that page has been hit, and the date and time of the last hit. I don't need the extra information that PHP/FI logs, and keeping it builds up huge mSQL tables. If you want to record
more data, it's not difficult to change this script.
If you don't want to lose those hits you've worked so hard to acquire, when this script checks for hits to a page and finds none, it looks to see if an old PHP/FI access log exists for that page, and, if so, takes the number of hits and the last access from the correct table, moving that data into its own database.
If you're going to check for old PHP/FI access logs, you need to assign the variable $UID to the UID you gave when initialising the phpfi database. If you don't want this check to be carried out, set the $check variable = false or remove the appropriate code.