Lawrence thanks for trying to help
I put in what you indicated taking out my garbage and I still get an "internal server error".
Do I need to put the info in a specific spot?
I tried where it is below and also directly under @$ips=
The following is the complete script with your recommended addition.
#!/usr/bin/perl --
###############################################################
# Text Counter V1.1
#
# This program is distributed as freeware. We are not
# responsible for any damages that the program causes
# to your system. It may be used and modified free of
# charge, as long as the copyright notice
# in the program that give me credit remain intact.
##################################################################
#
# COPYRIGHT NOTICE:
#
# Copyright 1999-2000 CGI-Factory.com TM
# A subsidiary of SiliconSoup.com LLC
#
#
#
# Text Counter V1.1 is protected by the copyright
# laws and international copyright treaties, as well as other
# intellectual property laws and treaties.
###################################################################
##################################Modify the area below
$invisible ="0";
#set to 1 if you want to counter to be invisible
$noreload ="1";
#set to 1 if you want to block the hit from page reloading
#if you set this variable to 1, remember to upload the file "testrecord.txt"
$flock="y";
###file locking. Don't change it to n unless your system has trouble using file locking.
####################### Nothing more need to be modified below this line unless you feel like to do it
@ips=("24.68.24.18","127.0.0.1");
if (!$ENV{'REMOTE_HOST'}) {
$host=$ENV{'REMOTE_ADDR'};
}
else {
$host=$ENV{'REMOTE_HOST'};
}
foreach $ip (@ips) {
exit if ($ip eq $ENV{'REMOTE_ADDR'});
}
open (count, "<testcount.txt") || &error("Unable to open the data for reading");
if ($flock eq "y") {
flock count, 2;
}
$count = <count>;
close (count);
if ($noreload ==1) {
open (record, "<testrecord.txt") || &error("Unable to open the data file for reading");
if ($flock eq "y") {
flock record, 2;
}
$pvisitor = <record>;
close (record);
open (wrecord, ">testrecord.txt") || &error("Unable to open the data file for writing");
if ($flock eq "y") {
flock wrecord, 2;
}
print wrecord "$host";
close (wrecord);
if ($host==$pvisitor) {
if ($invisible==1) {
print "Content-type: text/html\n\n";
exit;
}
print "Content-type: text/html\n\n";
print "$count";
exit;
}
}
$count++;
open (wcount, ">testcount.txt") || &error("Unalbe to open the data for writing");
if ($flock eq "y") {
flock wcount, 2;
}
print wcount "$count";
close (wcount);
if ($invisible==1) {
print "Content-type: text/html\n\n";
exit;
}
print "Content-type: text/html\n\n";
print "$count";
exit;
sub error{
print "Content-type: text/html\n\n";
print "An error has been occured. The error is: $_[0]<br>\n";
print "$!";
exit;
}