Board index   FAQ   Search  
Register  Login
Board index PHP Your Scripts

Free hitcounter with IMGS

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

Free hitcounter with IMGS

Postby ionutica » Tue May 10, 2011 6:10 am

It works with digits(imgs)!
Code: Select all
<?php
if($_COOKIE["countplus"] != 1)
{
$txt = file_get_contents("counter.txt");
$txt++;
file_put_contents("counter.txt", $txt);
$txt = file_get_contents("counter.txt");
$l = strlen($txt);
$nrofo = 6 - $l;

for ($i = 0; $i <= $nrofo; $i++) {
    echo "<img src='../IMG/0.bmp'>";
}
for ($i = 0; $i <= $l - 1; $i++) {
    echo "<img src='../IMG/" . $txt[$i] . ".bmp'>";
}
setcookie("countplus", "1", time()+60*60*24);
} else
{
$txt = file_get_contents("counter.txt");
$l = strlen($txt);
$nrofo = 6 - $l;

for ($i = 0; $i <= $nrofo; $i++) {
    echo "<img src='../IMG/0.bmp'>";
}
for ($i = 0; $i <= $l - 1; $i++) {
    echo "<img src='../IMG/" . $txt[$i] . ".bmp'>";
}

}
?>

Copy the digits in a folder called IMG(I put them as a attachment)
Attachments
digits.zip
The Digits
(2.46 KiB) Downloaded 48 times
User avatar
ionutica
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon May 09, 2011 11:23 pm

Return to Your Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.