You could create a generic class, say something like this - algorithm below:
class FileHits
{
function Hit()
{
$filename = $_SERVER["SCRIPT_NAME"];
// connect to database
// open database
// query to see if $filename exists
// if it exists UPDATE count by 1
// if it doesn't exist insert the filename and set count to 1
// disconnect from database
}
}
The trick is to use the SCRIPT_NAME as an index so you don' t have to go out and type in tons of filenames into the database to start things off! 😃
Kerry Kobashi
Kobashi Computing