|
Sei il visitatore N°
// hit'em counter
// (c) tom erickson (like i can even do anything if you steal it)
// verylost.f2o.org
// lost@verylost.f2o.org
$countertype = "image"; // put "text" or "image", choose which counter style you want
$imagetype = ".gif"; // if using "image" above, put in the extension with the '.' of the img files. ie: ".gif",".jpg",".png"
$numofdigits = 1; // number of digits to show, if number of digits in hits is less than this, tack as many '0's on the front as needed
error_reporting(0); // because of some stupid e_notice
if (!file_exists('counter.txt')) {
$fp = fopen('counter.txt','w');
fwrite($fp,'0');
}
$fp = fopen('counter.txt','r');
$counta = fgets($fp);
$host = $HTTP_SERVER_VARS["HTTP_HOST"];
if(!strstr($HTTP_SERVER_VARS['HTTP_REFERER'], $host)) {
$counta++;
$fp = fopen('counter.txt','w');
fwrite($fp,$counta);
}
$digits = array();
$digitlen = strlen($counta);
// this fills in the 0's before the number of hits, according to $numofdigits
$zerostofill = $numofdigits - $digitlen;
if ($zerostofill > 0) {
$countc = 1;
while ($countc <= $zerostofill) {
$countd .= 0;
$countc++;
}
$countc = $countd.$counta;
} else $countc = $counta;
if ($countertype != "image") echo $countc; //checks if the counter type is set to image, otherwise just print out the num of hits
else {
$countb = 0;
// and this finds the number of digits, and assigns each digit to part of an array, then gets the corresponding array[num], and prints it
while ($countb < strlen($countc)){
$digits[$countb] = substr($countc,$countb,'1');
$countb++;
}
$countb = 0;
while ($countb < strlen($countc)) {
echo ' ';
$countb++;
}
}
// end hit'em code
?>
dal 29 maggio 2000+3
www.17perso.it
- Tutti i diritti riservati
Federico Briata
|