X-Git-Url: http://git.i-scream.org/?a=blobdiff_plain;f=cgi-bin%2Fdocs.cgi;fp=cgi-bin%2Fdocs.cgi;h=ea7fdf8b3e1c7883318d764bfc8e9a833ef407c0;hb=b85ad0f3e5db5575c19957c4262383fa96421adc;hp=0000000000000000000000000000000000000000;hpb=916ec3e680ef758a71643bb487acfd63af53869a;p=www.i-scream.org.git diff --git a/cgi-bin/docs.cgi b/cgi-bin/docs.cgi new file mode 100755 index 0000000..ea7fdf8 --- /dev/null +++ b/cgi-bin/docs.cgi @@ -0,0 +1,94 @@ +#!/usr/bin/perl -w + +#------------------------------------------------------------ +# docs.cgi +# +# Web-based text file viewer. +# Copyright Paul Mutton, 2000. +#------------------------------------------------------------ + +use strict; +use CGI; + +$| = 1; + +# Settings +my ($left) = "../left.inc" ; +my ($title) = "../title.inc"; +my ($bottom) = "../bottom.inc"; + + +my ($query) = new CGI; +my ($doci) = ($query->param('doc') =~ /^\s*(.*?\.txt)\s*$/); +my ($doc) = "../documentation/$doci"; + +print "content-type: text/html\n\n"; + +print <<"END"; + + + + + + + + The i-scream Project Documentation Viewer + + + + + + + + + + + + +
+END + +&print_file($left); + +print <<"END"; + + +END + +&print_file($title); + +print "
\n";
+&print_file($doc);
+print "
\n"; + +&print_file($bottom); + +print <<"END"; + +
+ + + + +END + +exit 0; + +sub print_file ($) { + my ($filename) = @_; + print `cat $filename`; +} + +sub print_file_old ($) { + my ($filename) = @_; + open(FILE, $filename) or die "Cannot open $filename: $!\n"; + while (my ($line) = ) { + print $line; + } +} +