# To call the counter just insert the following code in your page after # changing the "/location/to/script/" to the correct location. # $countfile = "cgi-bin/281count.dat"; # Location to the file to hold the current count. Must be named c2ezcount.dat. # Just change the path to the file. $invisible = "0"; # "1": Counter will be invisible. # "0": Counter will be visible. $block_repeats = "0"; # "1": Blocks the reload button. # "0": Does not block the reload button. $private = "1"; # "1": Call must come from the site listed in @referers. # "0": Call can be from ANY site ANYWHERE! @referers = ("281.com","www.281.com"); # If private is "1" then set else leave at "0". # Must have www.domain.com, domain.com, and IP Address. # For more information see http://www.websitereporter.com/support $digit_dir = "http://home.281.com/cgi-bin/digits"; # URL of the digits. Must be accessable via web browser. $ending ="gif"; # Ending of digits, either "gif" or "jpg"; $same_digit_size = "1"; # "1": If the digits are SAME sizes. FASTER DISPLAY TIME # "0": If the digits are DIFFERENT sizes. SLOWER DISPLAY TIME $width = "21"; # Width of digits if the same size. $height = "21"; # Height of digits if the same size. #______________________________________________________________________ # If you still need help see http://www.websitereporter.com/support # or please email mailto:c2ezcount@websitereporter.com ####################################################################### ########################> END USER OPTIONS <########################### ####################################################################### ### !!!! DO NOT CHANGE ANYTHING BELOW THIS LINE !!!! ### ####################################################################### $host = $ENV{'REMOTE_HOST'}; if($private == 1) { &check_referer; } &incrementcounter; # &check_invisibility; $num = $length = length($count); while ($num > 0) { $NUMS{$num} = chop($count); $num--; } $i = 1; print " You are visitor :
\n\n"; while ($i <= $length) { if($same_digit_size == "1"){ print""; } else{ print""; } $i++; } &congrat; exit(0); ########################################### sub congrat{ $congrats = 10001; #Edit this number. open(COUNT, "$countfile"); $number = ; close(COUNT); $number++; if( $number eq $congrats ) { print "

CONGRATULATIONS!


"; } else { print"
"; } } ####################################################################### # Checks for valid counter call # sub check_referer { if (@referers && $ENV{'HTTP_REFERER'}) { foreach $referer (@referers) { if ($ENV{'HTTP_REFERER'} =~ m/$referer/) { $ref = 1; last; } } } else { $ref = 1; } if ($ref != 1) { $badreferer = "$digit_dir/bad_referer.gif"; print "Location: $badreferer\n\n"; exit; } } # # ####################################################################### ####################################################################### # Checks for invisible counter # # sub check_invisibility { # if ($invisible == "1") { # print "\n\n"; # print "\n"; # exit(0); # } # } # # ####################################################################### ####################################################################### # Increment the counter file # sub incrementcounter { if (-e $countfile) {open(COUNT,"+<$countfile") || die("Can't open $countfile: $!\n"); flock(COUNT,$lock); $count = ; chop $count; $lastvisitor = ; chop $lastvisitor; if ( ($block_repeats == "1") && ($host == $lastvisitor) ) { $dont_log = "1"; } else { $count++; } $number = $count; } else {open(COUNT,">$countfile") || die("Can't open $countfile: $!\n"); flock(COUNT,$lock); $count = 1; } seek(COUNT,0,0); print (COUNT "$count\n$host\n"); flock(COUNT,$unlock); close(COUNT); } # # #######################################################################