Solved

Hit Counter

Posted on 2001-07-26
4
187 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

726 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