where the best place to get one i need a small one not that big on the page any ideas ?
where the best place to get one i need a small one not that big on the page any ideas ?
Heres a really simple one I wrote in PHP.
You need to create a file called count_data.txt in the same directory as this count.phpPHP Code:
<?php
$counter = "count_data.txt";
if (file_exists($counter)) {
$fp = fopen($counter, "r+");
flock($fp, 1);
$count = fgets($fp, 4096);
$count += 1;
fseek($fp,0);
fputs($fp, $count);
flock($fp, 3);
fclose($fp);
} else {
echo "Can't find file, check '$counter' exists and is chmod 777";
die() ;
}
?>
<?php echo $count; ?> impressions on this page.
thanks for the reply mate ill have ago at it tomorrow when i come back from collage
Any probs give us a shout mate
yeah just tryed it works great thanks
@WTD
Hi WTD. Just found your post on php and as a complete newbie to web design I was wondering how to incorporate this into a webpage? I’ve tried creating a blank webpage and inputting the code in-between the body /body tags but all that happens when I open it is a page with "impressions on this page" at the top, any help would be appreciated.
Thanks for your time
Brian
Does your host support PHP?
you must upload it to your webspace and make sure your change the txt to chmod 777 else it wont work like i found out
Social Networking Bookmarks