#!/usr/local/bin/perl # Name ksl-guest2 # Date Sun Jul 02 1995, 04:36:55 AM # Author Kang, SoonLai # http://www.eecs.ukans.edu/~skang/ # skang@eecs.ukans.edu or buddha@falcon.cc.ukans.edu # Credit Christian Gerdes (http://www.big.hfb.se/~gerdes) # # # This script allows you to have multiple guestbooks. # # To use it: # 1. YOu must include your username and a name for your guestbook. # e.g.
# where skang is my username, and guestbook1.html is the filename. # 2. You must first create the file, then make the file world # writable, that is change its permission to 757. # 3. The file must reside in the .public_html dir, or you must # include the path. # ############################################################################### $_ = ; # process the POST format s/^username\=//; s/\+/ /g; s/%(..)/pack("c",hex($1))/ge; # split the arguments ($user, $file) = split(/\\&/,"@ARGV"); $path = "/users/$user/.public_html/$file"; # get time ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $date = sprintf("%02d:%02d:%02d %02d/%02d/%02d", $hour,$min,$sec,$year,$mon+1,$mday); # append to the end of the blackboard-file open(OUT, ">> $path"); print OUT ; print OUT "$date" ; print OUT "\n
\n"; close(OUT); # print message print "Content-type: text/html\n\n"; print "

Your tag has been added to the Guest Book!

";