#! c:/perl/bin/perl # # album.cgi # Photo album. Display photo with comments. # # 1.02 : 8/3/03 : Fixed back link # 1.01 : 8/2/03 : Added $imagedir # 1.0 : 7/26/03 : Created # Hideki Kanayama #### Environement setup from here ############## # A directory name which $script(default is album.cgi) is located.(relative path from shtml file which describes SSI. $subdir = "."; # A directory name which images are located.(relative path from album.cgi) Can be set as an URL starting from http://. $imagedir = "."; # This script name $script = "album.cgi"; # list file name. Put file name, title and comments in it. $file = "album.lst"; # Parent file to go back.(relative path and file name from where album.cgi is located or from http://) $back = "album.shtml"; #### Environement setup until here ############## if ($ENV{"REQUEST_METHOD"} eq "POST"){ read(STDIN,$data,$ENV{"CONTENT_LENGTH"}); } else { $data = $ENV{"QUERY_STRING"}; } @tmparry=split(/&/,$data); foreach $string (@tmparry){ ($key,$value)=split(/=/,$string); $value =~ tr/+/ /; $in{"$key"}=$value; } if ($in{file} eq ''){ &linklist; } else { &dispphoto; } sub linklist { print "Content-Type: text/html\n\n"; if (!open(FILE,"< $file")){ print "
| $comment |