It is sent to the CGI script on my host's server. Everything is sent to my email address just fine except for 2 problems;
1) whenever I press submit, I don't know how to have the next page that appears be one that gives a successful submission message. Instead, it just gives a Forbidden message (go and click on submit and you will see what I mean). How do I change this?
2) the email message I recieve doesn't include the atached files. It says the file was attached but nothing is there. Ideas?
I am trying to learn the scripting now (because I have got to the point where I want to add these things to my personal websites) and will buy a book or 2, but any help just getting me over this first problem is appreciated.
Below is my host's script that I use:
#!/usr/bin/perl -T
sub parse_form_data
{
local (*FORM_DATA) = @_;
local ( $request_method, $query_string, @key_value_pairs, $key_value, $key, $value);
$request_method = $ENV{'REQUEST_METHOD'};
if ($request_method eq "GET") {
$query_string = $ENV{'QUERY_STRING'};
} elsif ($request_method eq "POST") {
read (STDIN, $query_string, $ENV{'CONTENT_LENGTH'});
};
@key_value_pairs = split(/&/, $query_string);
foreach $key_value (@key_value_pairs) {
($key, $value) = split (/=/, $key_value);
if (defined($value)) {$value =~ tr/+/ /;
$value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;};
if (defined($FORM_DATA{$key})) {
$FORM_DATA{$key} = join (" ", $FORM_DATA{$key}, $value);
} else {
$FORM_DATA{$key} = $value;
}
}
}; # end of sub
&parse_form_data(*simple_form);
$t = time;
open (OUTFILE, ">/data/gdform_$t") or die ("Cannot open file");
while (($key , $value) = each(%simple_form)) {
print OUTFILE "<GDFORM_VARIABLE NAME=$key START>\n";
print OUTFILE "$value\n";
print OUTFILE "<GDFORM_VARIABLE NAME=$key END>\n";
if ($key eq "redirect") { $landing_page = $value;}
}
close (OUTFILE);
if ($landing_page ne "") {
print "Location: [$ENV{'HTTP_HOST'}...]
} else {
print "Location: [$ENV{'HTTP_HOST'}...]
}
[edited by: jatar_k at 3:27 am (utc) on Feb. 23, 2004]
[edit reason] no personal urls thanks [/edit]
I guess I can't provide the link to the form as I had originally, because it got edited out.
thx for help