PDA

View Full Version : Hits Today Script [REQ]



PartyRing
20-09-2007, 02:54 PM
Does anyone have or know where to get a script that displays how many hits have been that day?

Eccentric
20-09-2007, 03:35 PM
theres a php one on techtuts,
ill update this post if i find the link :)
http://www.techtuts.com/forums/index.php?showtopic=29

Luke
21-09-2007, 03:57 PM
theres a php one on techtuts,
ill update this post if i find the link :)
http://www.techtuts.com/forums/index.php?showtopic=29

oo, i've also bene looking for this, thanks :P

Eccentric
21-09-2007, 05:34 PM
Thats ok :) nd ppl say techtuts suck :S

lolwut
26-09-2007, 04:55 PM
I know there's already been one posted, but, I was bored, so I coded this;


<?php
$hits = file("hits_today.txt");

$hits[0] ++;
$fopen = fopen($hits , "w");
fputs($fopen , "$hits[0]");
fclose($fp);
echo("Hits Today: ");
echo $hits[0];

$date = date(H);
if($date = 23) {
$fopen = fopen($hits , "w");
fputs($fopen , " ");
fclose($fp);
}
?>
Then make a .txt called hits_today.txt

(I think there's an easier way of emptying a file's contents, but I can't remember)

Want to hide these adverts? Register an account for free!