1 |
< |
#!/usr/bin/perl -w |
1 |
> |
#!/usr/bin/perl |
2 |
|
|
3 |
|
#-------------------------------------------------------------- |
4 |
|
# download.cgi |
5 |
|
# |
6 |
< |
# A Perl CGI script that requests a user's email address |
7 |
< |
# before they may download a build from the i-scream web site. |
8 |
< |
# It is not essential for them to enter their email address. |
6 |
> |
# A Perl CGI script that requests some details from the user |
7 |
> |
# before they download a build from the i-scream web site. |
8 |
> |
# To assist the paranoid, all fields are optional. |
9 |
|
# |
10 |
|
# Copyright Paul Mutton, 2001. |
11 |
|
#-------------------------------------------------------------- |
19 |
|
#-------------------------------------------------------------- |
20 |
|
# Essential Settings |
21 |
|
#-------------------------------------------------------------- |
22 |
< |
my $build_dir = "/builds"; |
23 |
< |
my $log_file = "download_log"; |
22 |
> |
my ($build_dir) = "/builds"; |
23 |
> |
my ($log_file) = "download_log"; |
24 |
|
#-------------------------------------------------------------- |
25 |
|
|
26 |
|
|
27 |
< |
my $query = new CGI; |
27 |
> |
my ($query) = new CGI; |
28 |
|
|
29 |
|
my ($file_name) = ($query->param('file_name') =~ /^\s*(.*)\s*$/); |
30 |
|
my ($your_name) = ($query->param('your_name') =~ /^\s*(.*)\s*$/); |
47 |
|
open(LOGFILE, ">>$log_file"); |
48 |
|
print LOGFILE "$date|$file_name|$your_name|$email_address|$country\n"; |
49 |
|
close(LOGFILE); |
50 |
< |
print "Location: $build_dir/$file_name\n\n"; |
50 |
> |
print $query->redirect("$build_dir/$file_name"); |
51 |
|
} |
52 |
|
else { |
53 |
|
print "Content-type: text/html\n\n"; |