home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / 05_02.iso / software / mhtmls / MagicHTMLStudio.exe / Disk1 / data1.cab / Program_Files / CGI / TextCount / counter.cgi < prev    next >
Encoding:
Text File  |  2002-03-06  |  363 b   |  21 lines

  1. #!/usr/bin/perl
  2.  
  3.  
  4.  $count_file = "count.txt";
  5.    open(COUNT,"$count_file") || die "$!\n"; 
  6.    $count = <COUNT>;
  7.    close(COUNT);
  8.    if ($count =~ /\n$/) {
  9.       chop($count);
  10.    }
  11.  
  12.    $count++;
  13.  
  14.    open(COUNT,">$count_file") || die "$!\n";
  15.    print COUNT "$count";
  16.    close(COUNT);
  17.  
  18.    print "Content-Type: text/html\n\n";
  19.    print "$count";
  20.  
  21.