use LWP::Simple; $ipaddress2 = get ('http://www.domain.com/ip-address.txt'); $number = get ('http://www.domain.com/counter.txt'); #### #!/usr/bin/perl use LWP::Simple; $ipaddressmain2main = get ('http://www.domain.com/ip-address.txt'); $numbermain = get ('http://www.domain.com/counter.txt'); $ipaddressmain = "/home/site1337/public_html/ip-address.txt"; $countermain = "/home/site1337/public_html/counter.txt"; $database = "/home/site1337/public_html/logs.shtml"; { open(numbermain,"$countermain"); $num = ; close(numbermain); if ($ipaddressmain2main == $ENV{'REMOTE_ADDR'}) { $num; } else { $num++; } open(NEWFILE,">$ipaddressmain") || die $!; print NEWFILE "$ENV{'REMOTE_ADDR'}\n"; close(NEWFILE); open(NUM,">$countermain") || die $!; print NUM "$num"; close(NUM); } $shortdate = `date +"%D %T %Z"`; chop ($shortdate); open (DATABASE,">>$database"); print DATABASE "$ENV{'REMOTE_ADDR'} - $shortdate - $ENV{'HTTP_USER_AGENT'} - http://$ENV{'HTTP_HOST'}$ENV{'REQUEST_URI'} - $ENV{'HTTP_REFERER'}\n"; close(DATABASE); $page = $in{'page'}; if ($page eq 'XXXXXXX') { print "Content-type: text/html\n\n"; print <; close(NUMBER); if ($ipaddress2 == $ENV{'REMOTE_ADDR'}) { $num; } else { $num++; } open(NEWFILE,">$ipaddress") || die $!; print NEWFILE "$ENV{'REMOTE_ADDR'}\n"; close(NEWFILE); open(NUM,">$counter") || die $!; print NUM "$num"; close(NUM); } print "Content-type: text/html\n\n"; print <