View Single Post
  #4 (permalink)  
Old 06-29-09, 06:26 PM
Boraan's Avatar
Boraan Boraan is offline
Coding Addict
 
Join Date: Jul 2007
Location: Clayton, NC
Posts: 292
Thanks: 0
Thanked 1 Time in 1 Post
When using perl it's best to let the script do the work. I'd take your form and get rid of the extra hidden values. If the script is failing it will most likely be a syntax error. In order to filter that out try letting perl do the job it was meant too
Code:
<form action="/cgi-bin/formmail.pl" method="POST">
<input type="text" name="recipient" value="">
<input type="text" name="subject" value="">
Next let perl handle all of the data.
Code:
#!/usr/bin/perl
use strict;

print "Content-type: text/html\n\n";

my($recipient) = "$FORM{recipient}";
my($subject) = "$FORM{subject}:'

# Check to see that all fields are filled out.
my(@required) = ("$recipient", "$subject");
foreach my $i(@required) {
if ($i eq "") {
print "You must fill in $i. Press back in your browser to try again.";
exit;
}

# Handle data if passed.
my($redirect) = "thankyou.html";

print redirect('$redirect');
Once your post information is good to post the information where you want it to go, perl will handle everything in between. Once the data matches on both forms they will work. character like @, if they aren't handled correctly will usually kick a syntax error, which is why we let perl handle them.
__________________
Dexter Nelson
Techdex Development & Solutions
========================
Internet Marketing For Programmers | Free Market Research in 15 Minutes or Less
My Software: Hotscripts Softpedia software.techdex.net
Reply With Quote