i need a page counter for my intrAnet..

J

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!
 
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($file, 1);
$count = fgets($file, 4096);
$count += 1; 
fseek($file,0);
fputs($file,$count);
flock($file, 3);
fclose($file);
}
$timeout = time()-(60*$timer);
?>

this example is from my site and records hits to /home/speedyb/public_html/site/inc/visits.txt
 
does this display the the number on the site?

im running windows 2000 server, and IIS, i think it does support PHP....
 
bravenet.com has decent counters, but i don't know if you can make them look like whatever you want.
 
Originally posted by jkoXP
does this display the the number on the site?

im running windows 2000 server, and IIS, i think it does support PHP....
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 :)
 
Originally posted by SPeedY_B
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 :)
I did all of that, but it dosnt seem to be working?
 
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.
 
Originally posted by SPeedY_B
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.
it didnt.. so how do i setup IIS so it supports php, and perl and cgi?

thanks for the help!
 
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?
 
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??
 
Originally posted by jkoXP
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??
Just type in http://server/path/page.php and it should work. There should be no difference between running it locally or remotely.
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back