jnscollier
05-05-2007, 03:59 AM
Soooo, I found this awesome script in one of the threads :
<?php
$cdata = file_get_contents("counter.txt");
$ndata = ($cdata+1);
$handle = fopen("counter.txt","w+");
fwrite($handle,$ndata);
fclose($handle);
echo "\n<br>".$cdata." visits";
?>
But, here's my issue and i'm hoping someone can help me...
All my blogs go to one page and I pull from a SQL table and display the data for the particular blog selected... Example:
/viewblogdetails.php?blogid=205
ok, so I put the above script on that page and it of course increments every time the page is pulled up - regardless of the particular blog. I want to make a counter that counts only the views for a particular blog. Is that possible? Can I modify this code to make that?
Any help would be appreciated! Thanks! :eek:
<?php
$cdata = file_get_contents("counter.txt");
$ndata = ($cdata+1);
$handle = fopen("counter.txt","w+");
fwrite($handle,$ndata);
fclose($handle);
echo "\n<br>".$cdata." visits";
?>
But, here's my issue and i'm hoping someone can help me...
All my blogs go to one page and I pull from a SQL table and display the data for the particular blog selected... Example:
/viewblogdetails.php?blogid=205
ok, so I put the above script on that page and it of course increments every time the page is pulled up - regardless of the particular blog. I want to make a counter that counts only the views for a particular blog. Is that possible? Can I modify this code to make that?
Any help would be appreciated! Thanks! :eek: