Hello, I'm having trouble configuring my perl form script to submit information! Form can be found here #!perl $body = "The following has been submitted by a customer who visited your form."; $subject = 'form information'; $URL = http://www.mysiteurl.com/index.htm; $sendmail = "/usr/sbin/sendmail -t"; $email = 'myemail.com'; read(STDIN, $FormData, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $FormData); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); ($name, $value) = split(/=/, $pair); $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/\r//g; $form{$First Name} = $value; $form{$Last Name} =~ $value; $form{$Email} =~ $value; $form{$Confirmed Email} =~ $value; $form{$Postal Code} =~ $value; } $body .= "\n\nFirst Name: $form{'First Name'}\n\nLast Name: $form{'Last Name'}\n\nE-mail address: $form{'Email'}\n\nConfirmed E-mail address: $form{'Confirmed Email'}\n\nPostal Code: $form{'Postal Code'}; open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!"; print SENDMAIL "Reply-to: noreply@myemailhere.com"; print SENDMAIL "Subject: $subject\n"; print SENDMAIL "From: email@email.com"; print SENDMAIL "To: $email\n"; print SENDMAIL "Content-type: text/plain\n\n"; print SENDMAIL $body; close(SENDMAIL); $foo .= "Thank you, $form{'First Name'} $form{'Last Name'}!"; $error = '1' unless open (TEMPLATE,$file); while(<TEMPLATE>) { s/<!-FORM CONTENT>/$foo/sig; $output .= $_; } close(TEMPLATE); if ($error) { print "Content-type: text/html\n\n<html><body>Sorry, your information could not be submitted at this time. Please try again later.<p>Error Message: $smtpoutput</body></html>"; } else { print "Content-type: text/html\n\n$output"; } Code (markup): upon submission I get this errors All help appreciated, tell me what I'm doing wrong and how I can fix it! Bonus $3 if you can tell me how to make the confirmed email field verify that the email inputted is the same as the email in the "email" field! I'll include a bonus $2 as a holiday bonus! Thank you all in Advance!
my suggestion use free contact forms and put their script +it seems your server have problem to access the files,you should go to ftp and put access for all users.
Since you changed the action= code I cant tell if it works or not, but at least your requested problem for a fix is fixed
HTTP 500 responses are usually unspecific , server is not sure of exact details. Here are most common things which cause it , Try troubleshooting them from point 1 and see if it fixes 1) Did you save/upload the file as binary or ASCII ? this is one of the major problems in pl. people don't upload them in ASCII mode, so the script doesn't run correctly. 2) . 777 permissions - if any of the PHP/Perl files have 777 permissions this will lead to '500 Internal Server Error'. The solution is to change their permissions to 755 3) Check the HTTP error log for details. Also enable all warnings and errors. Do a "perl -wc scriptname.pl" on terminal to run and check syntax without executing. 4) Use this statement "use strict;" in top of the script. Or is the path to send mail and cgi/modules correct? 5) See the http web error log and let us know.