--- web/cgi-bin/download.cgi 2001/03/31 10:53:58 1.1 +++ web/cgi-bin/download.cgi 2001/03/31 12:00:29 1.3 @@ -1,11 +1,11 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl #-------------------------------------------------------------- # download.cgi # -# A Perl CGI script that requests a user's email address -# before they may download a build from the i-scream web site. -# It is not essential for them to enter their email address. +# A Perl CGI script that requests some details from the user +# before they download a build from the i-scream web site. +# To assist the paranoid, all fields are optional. # # Copyright Paul Mutton, 2001. #-------------------------------------------------------------- @@ -19,12 +19,15 @@ $| = 1; #-------------------------------------------------------------- # Essential Settings #-------------------------------------------------------------- -my $build_dir = "/builds"; -my $log_file = "download_log"; +my ($build_dir) = "/builds"; +my ($log_file) = "download_log"; +my ($left) = "../left.inc" ; +my ($title) = "../title.inc"; +my ($bottom) = "../bottom.inc"; #-------------------------------------------------------------- -my $query = new CGI; +my ($query) = new CGI; my ($file_name) = ($query->param('file_name') =~ /^\s*(.*)\s*$/); my ($your_name) = ($query->param('your_name') =~ /^\s*(.*)\s*$/); @@ -47,15 +50,46 @@ if (defined($submit) && $submit eq "Download") { open(LOGFILE, ">>$log_file"); print LOGFILE "$date|$file_name|$your_name|$email_address|$country\n"; close(LOGFILE); - print "Location: $build_dir/$file_name\n\n"; + print $query->redirect("$build_dir/$file_name"); } else { print "Content-type: text/html\n\n"; - - print < + + + - - + + + i-scream downloads + + + + + + + + + + + + +
+END + + &print_html($left); + + print <<"END"; + +END + + &print_html($title); + + print <
@@ -102,7 +136,26 @@ else { EOT -} + &print_html($bottom); + print <<"END"; -exit; \ No newline at end of file +
+ + + + +END + +} + +exit; + + +# Print a file without escaping HTML: - +sub print_html ($) { + my ($filename) = @_; + print `cat $filename`; +} \ No newline at end of file