#!/usr/local/bin/perl # # program name : gacssi (graphic-type access counter by Server Side Include) # # function : count the number of guest. # # calling form :Insert next line in html file, but remove first colum '#' # which means comment in perl. # # # note : This counter is made for Web site where both SSI and CGI # are available. # # programmer : makoto takenaka : takesoft@mxs.meshnet.or.jp # # copyright : (C) 1997 by Makoto Takenaka # # version(date): # 1.0(Jan 8, 1997) # 1.1(April 6, 1997) Change "print HTML_FILE" to "print" in (3). # #(1) set constants. # # guest number file name $count_file = "/home/user3/user-id/public_html/count.txt"; # # directory of number gif files by relative path name. $gif_dir = "./image/"; # #(2) Increment $count. # open(COUNT_FILE, "+< $count_file") || die("gacssi: Unable to open $count_file"); flock(COUNT_FILE, 2); $count = ; $count++; seek(COUNT_FILE, 0, 0); print COUNT_FILE $count; flock(COUNT_FILE, 8); close(COUNT_FILE); # #(3) insert counter image tags. # $nd = length($count); # for ($digit = $nd; $digit > 0; $digit--) { $d = substr($count, (-1)*($digit), 1); $gif_file = "$gif_dir$d.gif"; print "\"$d\""; } #