Counter

How to add a counter to my html where i can to how many people are enter my homepage.
tonyckxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rajeshsundaramCommented:
Dear Tony,
   There are many websites providing free counters to be put up on UR web page. When the food is ready to eat then Y we have to cook???  Hope U understood ....
One of the site is http://counter.mycomputer.com/counter_com_index.html

Regards,
Rajesh
0
chewymonCommented:
Another option is to check with your ISP or hosting company.  A lot of them provide cgi counters to the customers.  Just check with the service rep.
0
SuperMarioCommented:
If you know Perl or CGI, you can always write one like this. Save it as myscript.cgi and upload it into your main directory. Also create a file called counter.txt with simply the number 1 in it.
Here's the CGI script:

#!/usr/local/bin/perl

$numHits;
$newVal;

&openCounter;

sub openCounter {
# open counter text file
open(CNT, "<counter.txt");
$numHits = <CNT>;
$newVal = $numHits + 1;
close(CNT);

#open counter again for writing
open(toWrite, ">counter.txt");
print toWrite $newVal;
close(toWrite);

#print results
print "Content-type: text/html\n\n";
print "Number of people to this page: $newVal";

}



Then in the body of your HTML, if your web host supports SSI (server-side includes) type this line in:

<!--#exec cgi="/myscript.cgi">


Anyway, if you don't know PERL or CGI, check out your host's site enhancement options. Go to their online site builder, if they have one, and see what kind of goodies they have. Geocities offers great counters. Angelfire does too.

Just see what you can come up with, man!

-Dan







0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.