Category: | Web Stuff |
Author/Contact Info | GreyFoxgreyfox@30gigs.comgreyfox@hacktek.net |
Description: | This is a simple hit counter I threw together for my website. Nothing fancy, it just |
#!/usr/bin/perl -w #Simple hit counter #To include in a webpage (HTML), put <!--#exec cmd="PATHTOCGISCRIPT.cg +i"--> in the document #Replacing PATHTOCGISCRIPT with the url to the CGI script (this script +). #For PHP, within the <?php and ?> tags, include "virtual("PATHTOCGISCR +IPT.cgi");" #without the quotes. Also, you need to create #a file named hits.txt for the script to access. It can #be blank #Script copyright 2006 GreyFox of hacktek.net #VARIABLES $file = "hits.txt"; #READING open (COUNT,"<$file") or die "Counter error 1"; $hits = <COUNT>; close COUNT; #INCREMENTING $hits++; #CONTENT print "Hits: $hits"; #SAVING open (COUNT,">$file") or die "Counter error 2"; print COUNT $hits; close COUNT; |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Simple Hit Counter
by gloryhack (Deacon) on May 29, 2006 at 20:55 UTC | |
Re: Simple Hit Counter
by CountZero (Bishop) on May 29, 2006 at 19:37 UTC | |
Re: Simple Hit Counter
by GreyFox (Initiate) on May 29, 2006 at 02:00 UTC | |
by rhesa (Vicar) on May 29, 2006 at 02:36 UTC |