Morpheusweb.it - Risorse per webmaster: script, ASP.NET, C#, Visual Basic .Net, tutorial, asp, javascript, css, php, html, java, ADO, VBScript, forms, frames, Active Server Pages, Dynamic HTML, database, gratis per webmaster e webdesigner

Cookies Digits Counter

Contatore grafico (utilizza i cookies).




<?php
$COUNT_FILE = "count_data.txt";
$IMG_DIR_URL = "./digits/";
$NB_DIGITS = 8;
$EXPIRE_DATE = 86400;
if (file_exists($COUNT_FILE)) {
    $fp = fopen("$COUNT_FILE", "r+");
    flock($fp, 1);
    $count = fgets($fp, 4096);
    if ($visited == "") {
        $count += 1;
        setcookie("visited", $count, time()+$EXPIRE_DATE , "/", $SERVER_NAME);
        fseek($fp,0);
        fputs($fp, $count);
    }
    flock($fp, 3);
    fclose($fp);
    } else {
        echo "Can't find file, check '\$file' var...<BR>";
        exit;
    }
    chop($count);
    $nb_digits = max(strlen($count), $NB_DIGITS);
    $count = substr("0000000000".$count, -$nb_digits);
    $digits = preg_split("//", $count);
    for($i = 0; $i <= $nb_digits; $i++) {
        if ($digits[$i] != "") {
            $html_result .= "<IMG SRC=\"$IMG_DIR_URL$digits[$i].gif\">";
        }
    }
?>
Visitors: <?php echo $html_result ?>


Scarica il Codice...


Stampa la pagina


 








Inizio pagina

risorse per webmaster

php

php

php, mail, database, banner
php, banner,

Vai nel sito Morpheusweb.it - Risorse per Webmaster troverai quello che stai cercando
php, banner,
Nel nostro sito molte informazioni: "Morpheusweb.it - Risorse per Webmaster" tratta di php, script, forms, mail, database
click here se non sei reindirizzato automaticamente al nostro sito.

php, script, banner, mail, database, , ,