#!/usr/bin/perl -w #Simple hit counter #To include in a webpage (HTML), put in the document #Replacing PATHTOCGISCRIPT with the url to the CGI script (this script). #For PHP, within the tags, include "virtual("PATHTOCGISCRIPT.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 = ; close COUNT; #INCREMENTING $hits++; #CONTENT print "Hits: $hits"; #SAVING open (COUNT,">$file") or die "Counter error 2"; print COUNT $hits; close COUNT;