#!/usr/local/bin/perl # # program name : tacs0.cgi(text-type access counter for secondary Web page # without counting up) # # function : Show Web page with guest number, but this cgi does not # increment count number. This cgi is for link from internal # Web page. # # programmer : makoto takenaka (takesoft@mxs.meshnet.or.jp) # # copyright : (c) 1996 by Takesoft # # version(date) : # version 1.0 (Nov 17, 1996) Made from tacs.txt(Ver.1.2) # #(1) set constants. # $html_file = "./main.html"; # Web page html file # $count_file = "./count.txt"; # counter file # #(2) Send html header lines. # print "Content-type: text/html\n\n"; # #(3) Read count number. # open(COUNT_FILE, "$count_file") || &error_message("Unable to open $count_file"); $count = ; close(COUNT_FILE); # #(4) Send html file to browser with count number. # #(4.1) Open html file. # open(HTML_FILE, $html_file)|| &error_message("Unable to open $html_file"); # while() { # #(4.2)If this line contains "INSERT_COUNTER", send count number. # if ( $_ =~ /INSERT_COUNTER/ ) { print $count; } else { print $_; } } # close(HTML_FILE); exit 0; #---------------------------------------------------------- sub error_message { local($message) = @_; print "Error Message from tacs0.cgi of Web page: \n"; print "$message\n"; exit 1; }