Solved

Hit Counter

Posted on 2001-07-26
4
183 Views
Last Modified: 2013-12-25
I'm curious how I would create a web counter using perl/cgi...

Anyone have any suggestions?

I don't need anything fancy, don't care about IP checking...

Thanks!
0
Comment
Question by:rockies1
4 Comments
 
LVL 6

Accepted Solution

by:
holli earned 100 total points
ID: 6324654
use Fcntl qw(:DEFAULT :flock);

sysopen (FH, "counter.dat", O_RDWR | O_CREAT, O666) or die "cannot write to counter: $!";
flock (FH, LOCK_EX) or die "flock-error: $!"; #lock the file

#read counter data here, increase it and write it back to file here

flock (FH, LOCK_UN) or die "flock-error: $!"; # unlock the file

close FH;



0
 

Expert Comment

by:kplonk
ID: 6328658
Do you have access to a data base to hold the counst or gust files on your server
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6699405
Please update/finalize this question.

Thanks,

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Computer101
ID: 6903909
Comment from expert accepted as answer.

Thank you
Computer101
E-E Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now