Results 1 to 23 of 23

Thread: Hit Counter

  1. #1

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Hit Counter

    Hi, all
    How do I make a Hit Counter for ny web page?
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  2. #2
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: Hit Counter

    does your server have php installed?
    If there is only one perfect person in the universe, does that make them imperfect?

  3. #3

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Re: Hit Counter

    Quote Originally Posted by dandono
    does your server have php installed?
    YES.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  4. #4
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: Hit Counter

    why dont you have a php page as your index and make that so that it adds 1 to the value that is in a text file and make your default page have a little php code that prints what is in that text file to the page.
    If there is only one perfect person in the universe, does that make them imperfect?

  5. #5

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: Hit Counter

    I do not know how to do it.
    My web address is http://bob5731.no-ip.info
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  6. #6
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: Hit Counter

    http://www.w3schools.com/php
    what you want to do is get it to read the value that is in a text doc and then do a sum of (whats in text doc) + 1 and save to the doc. i can make a code but i dont have enough time at the mo. i will make it in like half an hour and post it.
    Last edited by dandono; May 2nd, 2005 at 09:21 AM.
    If there is only one perfect person in the universe, does that make them imperfect?

  7. #7

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: Hit Counter

    The link dose not work for me.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  8. #8
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: Hit Counter

    Here, http://w3schools.com/php/. It's a typo.

  9. #9
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Hit Counter

    Still a bad link.

  10. #10
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: Hit Counter

    Attached Images Attached Images  

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Hit Counter

    Figured it out.

    http://www.w3schools.com/php/
    Attached Images Attached Images  

  12. #12

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: Hit Counter

    No help yet.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  13. #13
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: Hit Counter

    VB Code:
    1. <?xml version="1.0" encoding="UTF-8"?>
    2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    3. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    4. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    5. <head>
    6. <title></title>
    7. <link rel="stylesheet" href="style.css"/>
    8. </head>
    9.  
    10. <body>
    11. <?php
    12. $count = file_get_contents("count.txt");
    13. $count = explode("=", $count);
    14. $count[1] = $count[1]+1;
    15. $file = fopen("count.txt", "w+");
    16. fwrite($file, "count=".$count[1]);
    17. fclose($file);
    18. print "count=".$count[1];
    19. ?>
    20. </body>
    21. </html>
    Full article, here.

  14. #14

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: Hit Counter

    No help yet.
    In html
    Last edited by bob5731; Apr 27th, 2005 at 10:34 AM.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  15. #15

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: Hit Counter

    how do I do it?

    Instructions:

    1) Download the EZ Counter zip.

    2) Unzip its contents and upload the files to your PHP enabled webserver.

    3) CHMOD "ezcounter.txt" to "777" so that the file is writeable.

    4) Add this line of PHP code to your page to increment and print the counter:

    include("ezcounter.php");
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  16. #16
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Hit Counter

    Quote Originally Posted by bob5731
    Instructions:

    1) Download the EZ Counter zip.

    2) Unzip its contents and upload the files to your PHP enabled webserver.

    3) CHMOD "ezcounter.txt" to "777" so that the file is writeable.

    4) Add this line of PHP code to your page to increment and print the counter:

    include("ezcounter.php");
    You need to follow those instructions.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  17. #17

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: Hit Counter

    How do I do.

    CHMOD "ezcounter.txt" to "777" so that the file is writeable
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  18. #18
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: Hit Counter

    try CHMOD "excounter.txt" to "0777" i dont know if there is a difference between "0777" and "777". sorry that i did not write code in time but someone uploaded a virus to my website (i am not talking about my self) so i have now blocked anonymous ftp on it.
    Last edited by dandono; Apr 27th, 2005 at 02:54 PM.
    If there is only one perfect person in the universe, does that make them imperfect?

  19. #19
    Addicted Member BIOSTALL's Avatar
    Join Date
    Apr 2005
    Location
    Northampton, UK
    Posts
    180

    Re: Hit Counter

    I have used the following code in my page and it works absolutely fine:

    <?php
    $countfilename = "VisitorCount.txt";
    $whattoread = @fopen($countfilename, "r") or die("Error opening count file");
    $contents = fread($whattoread, filesize($countfilename));
    fclose($whattoread);

    $contents = ($contents + 1);

    $whattoread = @fopen($countfilename, "w") or die("Error opening count file1");
    @fwrite($whattoread, $contents) or die("Error with addition");

    fclose($whattoread);
    echo $contents;
    ?>

    Just make sure you set the VisitorCount.txt CHMOD to 777. I do this via an FTP client, much easier!!

    BIOSTALL

  20. #20

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Angry Re: Hit Counter

    Can you all make the file for me.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  21. #21
    Addicted Member BIOSTALL's Avatar
    Join Date
    Apr 2005
    Location
    Northampton, UK
    Posts
    180

    Re: Hit Counter

    U mean the text file or the php file??

  22. #22

    Thread Starter
    Fanatic Member bob5731's Avatar
    Join Date
    Nov 2004
    Posts
    918

    Re: Hit Counter

    the text and php.
    P.S. God Love You And Have A Good Day!!!My web page

    I need to get a free Iphone

  23. #23
    Hyperactive Member dandono's Avatar
    Join Date
    Aug 2004
    Location
    Cornwall, UK
    Posts
    485

    Re: Hit Counter

    try this zip file. it is what i use on my server and it works fine. it is an image counter.
    Attached Files Attached Files
    If there is only one perfect person in the universe, does that make them imperfect?

Posting Permissions

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



Click Here to Expand Forum to Full Width