jaxong
09-12-2007, 09:36 PM
Hello,
I've built a form in Adobe LiveCycles and I want to submitt the data to an email via the post method. I cant get anything from the pdf form I've created to submitt. So I got another script in order to test out the post method on my server. But I cant get that to do anything either. Here is my form and here is the link www.texassaltwaterfishingmagazine.com/form.htm (http://www.texassaltwaterfishingmagazine.com/form.htm)
<form method="post" action="scriptform.cgi">
Your name: <input type="text" name="name"><br>
Your email: <input type="text" name="email"><br>
Your comment: <textarea name="comment"></textarea><br>
<input type="submit">
</form>
Here is the scriptform.cgi file
#!/home/texassal/perl
use CGI::Carp qw(fatalsToBrowser);
# The following accepts the data from the form and splits it into its component parts
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
# Then sends the email
open (MESSAGE,"| /usr/sbin/sendmail -t");
print MESSAGE "To: you\@example.com\n"; # Don't forget to escape this @ symbol!
print MESSAGE "From: " . $FORM{name} . ", reader\n";
print MESSAGE "Reply-to: " . $FORM{email} . "(" . $FORM{name} . ")\n";
print MESSAGE "Subject: Feedback from $FORM{name} \n\n";
print MESSAGE "$FORM{name} wrote:\n\n";
print MESSAGE "Comment: $FORM{comment}\n\n";
print MESSAGE "Sent by: $FORM{name} ($FORM{email}).\n";
close (MESSAGE);
&thank_you; #method call
}
I have loaded the cgi file into the same directory as the html file containing my form. When I attemp to test the form it doesn't ever submit. The status bar says "waiting on http://www....../scriptform.cgi" Then it finaly times out. I've adjusted the permissions to be 755 on the file. Still nothing does anyone have any advice on this? Also if any one knows about the Adobe LiveCycles coding and can help with that I would really appreciate it. Thanks for your help in advance!
I've built a form in Adobe LiveCycles and I want to submitt the data to an email via the post method. I cant get anything from the pdf form I've created to submitt. So I got another script in order to test out the post method on my server. But I cant get that to do anything either. Here is my form and here is the link www.texassaltwaterfishingmagazine.com/form.htm (http://www.texassaltwaterfishingmagazine.com/form.htm)
<form method="post" action="scriptform.cgi">
Your name: <input type="text" name="name"><br>
Your email: <input type="text" name="email"><br>
Your comment: <textarea name="comment"></textarea><br>
<input type="submit">
</form>
Here is the scriptform.cgi file
#!/home/texassal/perl
use CGI::Carp qw(fatalsToBrowser);
# The following accepts the data from the form and splits it into its component parts
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
# Then sends the email
open (MESSAGE,"| /usr/sbin/sendmail -t");
print MESSAGE "To: you\@example.com\n"; # Don't forget to escape this @ symbol!
print MESSAGE "From: " . $FORM{name} . ", reader\n";
print MESSAGE "Reply-to: " . $FORM{email} . "(" . $FORM{name} . ")\n";
print MESSAGE "Subject: Feedback from $FORM{name} \n\n";
print MESSAGE "$FORM{name} wrote:\n\n";
print MESSAGE "Comment: $FORM{comment}\n\n";
print MESSAGE "Sent by: $FORM{name} ($FORM{email}).\n";
close (MESSAGE);
&thank_you; #method call
}
I have loaded the cgi file into the same directory as the html file containing my form. When I attemp to test the form it doesn't ever submit. The status bar says "waiting on http://www....../scriptform.cgi" Then it finaly times out. I've adjusted the permissions to be 755 on the file. Still nothing does anyone have any advice on this? Also if any one knows about the Adobe LiveCycles coding and can help with that I would really appreciate it. Thanks for your help in advance!