Results 1 to 9 of 9

Thread: PHP visitor counter

  1. #1
    Join Date
    Dec 2004
    Posts
    15

    Default PHP visitor counter

    Can anyone help me with creating my PHP Counter or provide me a completed script ? I’m looking for a simple script that uses a .txt file to store the counter value. There should also be a function that users are not counted twice in the same session (I think this works with the user’s IP number). Thanks for support !

  2. #2

    Default I host free counters

    I host free counters, but I need 20 post to get php working. so tell then I don't know what to do.
    sorry i couldn't be more help.

  3. #3
    Join Date
    Nov 2004
    Posts
    19

    Default supreme

    You cen download script forom this link
    Code:
    http://www.hotscripts.com/jump.php?listing_id=15286&jump_type=1


    if you have dificulties to understand what is what
    u bether use PHP nuke or something like nuke site

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    10

    Default

    Try this site.... http://www.bigwebmaster.com/1701.html

    It stores the variable in a text file therefore easy to change etc.

    Hope this helps - it's free as well...

  5. #5
    Join Date
    Dec 2004
    Posts
    7

    Default

    Here is code. Sorry, but comments in Russian :D If you don't understand anything, i can translate :)
    You need create a *.png file as source(background) of you counter.

    ----- file: counter.php ------- use [img]counter.php[/img]
    Code:
    <?
    $dat_file="includes/counter/counter.dat"; // Counter data file
    $log_file="includes/counter/counter.log"; // Log with IP's
    // Открывем файл счетчика и считываем текущий счет
    // в переменную $count
    $f=fopen($dat_file,"r");
    $count=fgets($f,100);
    fclose($f);
    
    $count=ereg_replace(" ","",$count); // Удаляем символ конца строки
    $count++; // Увеличиваем счетчик
    // Записываем данные обратно в файл
    $f=fopen($dat_file,"w");
    fputs($f,"$count ");
    fclose($f);
    
    // Создаем новое изображение из файла
    $im = ImageCreateFromPNG('images/counter.png');
    // Назначаем черный цвет
    $black = ImagecolorAllocate($im,0,0,0);
    // Выводим счет на изображение
    Imagestring($im,1,5,20,$count,$black);
    // Выводим изображение в стандартный поток вывода
    Header("Content-type: image/png");
    ImagePng($im);
    
    // Записываем IP посетителя
    $f=fopen($log_file,"a+");
    $ip=getenv("REMOTE_ADDR");
    fputs($f,"$ip ");
    fclose($f);
    ?>

  6. #6
    Join Date
    Sep 2004
    Location
    Johor Bahru, Malaysia
    Posts
    516

    Default

    use this:
    Code:
    http://www.my-script.com/

  7. #7
    Join Date
    Dec 2004
    Location
    malaysia
    Posts
    23

    Default

    that good counter ..
    but dont have stat for every country ??

    why malaysia aje yg banyak .. hehehehe

  8. #8
    Join Date
    Dec 2004
    Location
    malaysia
    Posts
    23

    Default

    i want use this counter but my php still not support

  9. #9
    Join Date
    Apr 2005
    Location
    Israel
    Posts
    23

    Default Counters code

    I already sent a link about counters , the link is at :
    http://www.hotscripts.com/PHP/Script...ers/index.html


    Enjoy :)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •