Form no longer sending. It used to work great. Is it a CGI issue?
Hello experts,
Recently my hosting had expired and all my files on GoDaddy were lost. No biggie, really. I think I found the original files on my computer, uploaded them, but now the form won't actually send when I hit the submit button.
Here is a link to the ugly but previously functional page: www.theotherdaveharrison.com/form.html
If you type something intothe text field and hit submit it gives an error message. (GoDaddy was unable to help). The email address that the form should send to is "dave@daveharrisonwebdesign.com" But part of the error message says "Please contact the server administrator at webmaster@theotherdaveharrison.daveharrison.info to inform them of the time this error occurred."
I don't know what "webmaster@theotherdaveharrison.daveharrison.info" is all about. They are two separate domains.
Any insight appreciated.
Thanks for any help,
Dave
--------
Here are the following CGI files that worked just fine before:
gdform:
#!/usr/bin/perl
sub parse_form_data
{
local (*FORM_DATA) = @_;
local ( $request_method, $query_string, @11361180_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'});
};
@11361180_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;
chdir ($ENV{'DOCUMENT_ROOT'}) ; chdir("..");
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: http://$ENV{'HTTP_HOST'}/$landing_page\n\n";
} else {
print "Location: http://$ENV{'HTTP_HOST'}/\n\n";
}
----
And gdformssl:
#!/usr/bin/perl
sub parse_form_data
{
local (*FORM_DATA) = @_;
local ( $request_method, $query_string, @11361180_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'});
};
@11361180_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;
chdir ($ENV{'DOCUMENT_ROOT'}) ; chdir("..");
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: https://$ENV{'HTTP_HOST'}/$landing_page\n\n";
} else {
print "Location: https://$ENV{'HTTP_HOST'}/\n\n";
}
