count3.cgi to HTML.

index -|- end

Generated: Sun Mar 2 17:19:44 2014 from count3.cgi 2013/10/20 392. text copy

#!/usr/bin/perl

print "Content-type: text/html\r\n\r\n";
$file = "/var/www/cgi-bin/counts/count3.txt";
$count = 0;
if ( -f $file ) {
  open (FIL, "<$file") || die("Could not open file $file!\n");
  $count = <FIL>;
  close (FIL);
}
open (FIL, ">$file") || die("Count not create file $file!\n");
$count++;
print FIL "$count\n";
close (FIL);
print "$count\n";
exit;

# eof
 

index -|- top

checked by tidy  Valid HTML 4.01 Transitional