downloaded, rather than "download.cgi"
#--------------------------------------------------------------
# download.cgi
#
#--------------------------------------------------------------
# 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.
#--------------------------------------------------------------
#
# Copyright Paul Mutton, 2001.
#--------------------------------------------------------------
#--------------------------------------------------------------
# Essential Settings
#--------------------------------------------------------------
#--------------------------------------------------------------
# Essential Settings
#--------------------------------------------------------------
-my $build_dir = "/builds";
-my $log_file = "download_log";
+my ($build_dir) = "/builds";
+my ($log_file) = "download_log";
#--------------------------------------------------------------
#--------------------------------------------------------------
my ($file_name) = ($query->param('file_name') =~ /^\s*(.*)\s*$/);
my ($your_name) = ($query->param('your_name') =~ /^\s*(.*)\s*$/);
my ($file_name) = ($query->param('file_name') =~ /^\s*(.*)\s*$/);
my ($your_name) = ($query->param('your_name') =~ /^\s*(.*)\s*$/);
open(LOGFILE, ">>$log_file");
print LOGFILE "$date|$file_name|$your_name|$email_address|$country\n";
close(LOGFILE);
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";
}
else {
print "Content-type: text/html\n\n";