FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

visit counting *php*

 


Matee
Code:
<?
//Power by Matee zastrzegam sobie prawa do tego licznika ;]

if (!file_exists("licznik.txt"))// jezeli plik licznik.txt nie istnieje

                                  {
                                  $licznik=fopen("licznik.txt","w"); // twozymy go
                                  }
         else
         {
         $licznik=fopen("licznik.txt","r+");
         }
$numer=fgets($licznik,10);
if ($numer=='')
$numer=0;

if(!isset($CLicznik))
                     {
                     rewind ($licznik);
                     $numer++;
                     fwrite($licznik,$numer);
                     fclose($licznik);
                     
                     setcookie("CLicznik","Ustawione ciasteczko",time()+3600);
                     }
                     echo("Odwiedziło <br />nas już <b>$numer</b> os.");

?>


next um mast in root make licznik.txt and give him a 777 atribut DONE.
smarties
can somebody explain the script in english. i'll really appreciate your effort. can you also add other script that count each guest and member. thanks
JANKOW
In english

Code:
<?
//Power by Matee right reserved;]

if (!file_exists("licznik.txt"))// if  file meter.txt does not exist

                                  {
                                  $licznik=fopen("licznik.txt","w"); // we create him
                                  }
         else
         {
         $licznik=fopen("licznik.txt","r+");
         }
$numer=fgets($licznik,10);
if ($numer=='')
$numer=0;

if(!isset($CLicznik))
                     {
                     rewind ($licznik);
                     $numer++;
                     fwrite($licznik,$numer);
                     fclose($licznik);
                     
                     setcookie("CLicznik","Ustawione ciasteczko",time()+3600);
                     }
                     echo(" It visited <br />  us to this time <b>$numer</b> persons .");

?>
mathiaus
smarties wrote:
can somebody explain the script in english. i'll really appreciate your effort. can you also add other script that count each guest and member. thanks


member of what? a forum or something else and if so which software/script?
puccavn
use GD function in PHP
to make an graphic counter
your website more nice !! Laughing
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.