i need a page counter for my intrAnet..

Discussion in 'PC Gaming' started by jkoXP, Dec 6, 2002.

  1. jkoXP

    jkoXP Guest

    cgi, dosnt matter, just one that looks good, or somethign that I can make my own images out of... thanks for the help!
     
  2. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    Do you have PHP ?

    I'll paste the code anyway as someone else may find it useful .... :)

    PHP:
    <?php
    if (file_exists("site/inc/visits.txt")) {
    $file fopen("site/inc/visits.txt""r+");
    flock($file1);
    $count fgets($file4096);
    $count += 1
    fseek($file,0);
    fputs($file,$count);
    flock($file3);
    fclose($file);
    }
    $timeout time()-(60*$timer);
    ?>
    this example is from my site and records hits to /home/speedyb/public_html/site/inc/visits.txt
     
  3. jkoXP

    jkoXP Guest

    does this display the the number on the site?

    im running windows 2000 server, and IIS, i think it does support PHP....
     
  4. omgsoup

    omgsoup OSNN Senior Addict

    Messages:
    284
    bravenet.com has decent counters, but i don't know if you can make them look like whatever you want.
     
  5. NetRyder

    NetRyder Tech Junkie Folding Team

    Messages:
    13,256
    Location:
    New York City
    If PHP is a problem, give this site a try. No banners/ads/popups, so it's great :)
    http://www.infinitefx.co.uk
    I used to use it before...
     
  6. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    hah, sorry, i completely forgot to mention ...
    PHP:
    <?include("site/inc/visits.txt");?>
    use that where-ever you want to display the number (i forgot about it as i have it in my <title> tags, so i didnt notice it :)
     
  7. jkoXP

    jkoXP Guest

    I did all of that, but it dosnt seem to be working?
     
  8. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
    You absolutely sure you have PHP ?
    create a new page with just this in..
    PHP:
    <?echo "hello world";?>
    then open it through a browser and "hello world" should be printed.
     
  9. jkoXP

    jkoXP Guest

    it didnt.. so how do i setup IIS so it supports php, and perl and cgi?

    thanks for the help!
     
  10. Where can I download and install PHP. Is that for the internet or locally on the computer? Do I need the net to run PHP?
     
  11. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
  12. SPeedY_B

    SPeedY_B I may actually be insane.

    Messages:
    15,800
    Location:
    Midlands, England
  13. jkoXP

    jkoXP Guest

    ok, so I can now view php files on my windows 2000 server box thanks to you guys..

    but, when I go to open the PHP file on a diff machine, the php page comes up blank (no hello world).. what did I do wrong??
     
  14. Thanks for the links, Zedric!
     
  15. Zedric

    Zedric NTFS Guru Folding Team

    Messages:
    4,006
    Location:
    Sweden
    Just type in http://server/path/page.php and it should work. There should be no difference between running it locally or remotely.