]> i-scream Git - www.i-scream.org.git/blobdiff - cgi-bin/download.cgi
Had to make some changes to ensure that the correct filename is
[www.i-scream.org.git] / cgi-bin / download.cgi
index d555c7fdc613eaa01b421738c7c00366b4974d22..9ae0bbfab27f075390082fffe3393dc8e7f9690b 100755 (executable)
@@ -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,12 @@ $| = 1;
 #--------------------------------------------------------------
 # Essential Settings
 #--------------------------------------------------------------
-my $build_dir = "/builds";
-my $log_file = "download_log";
+my ($build_dir) = "/builds";
+my ($log_file) = "download_log";
 #--------------------------------------------------------------
 
 
-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,7 +47,7 @@ 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";