I have a real estate listing site an I would like to have a stat counter that the lister can use. My listings page now uses the get method to display the listing. ie
http:mysite.com/listings.php?id=15
so what do you think the best approach to registering the page views?
I have this simple script
Code: Select all
<?php
$count_my_page = ("hitcounter.txt");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
echo $hits[0];
?>
it just uses an include
<
should I pass the get id to the script and then have the script update the database? Is that too much work im creating for myself? Well any suggestions would be greatly appreciated. Also I am going to use mod rewrite to clean up my urls. If I do that will I have any other issues with the counter?
thanks