angela5780
Programmer
I really don’t know what I’m doing, but I need my text fields to import to my email fields so I get an email from the person who fills out the form. The form is in my perl script. Does anyone have any tips on how I can do this. I get a blank email now.
#!/usr/local/bin/perl
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
}
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<BODY BGCOLOR=#FFFFFF>\n";
print "<CENTER>\n";
print "JAPANESE WOMEN BOWING IN TRADITIONAL GREETING";
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
print "$fields{name}</BR>";
print "$fields{email}<BR>\n";
use CGI ":all";
$radio_action = param("radio_action");
$option = param("option");
print br, "I have agreed to the tems of sale: ", br,
radio_group(-name=>"radio_action",
-values=>['Yes,'],
-default=>'1',-override=>1);
if ($radio_action eq "Yes, I have agreed to the terms of sale")
{
}
$option = param("option");
print "<CENTER>\n";
print header, start_form,
print "I have read and agree to the terms and conditions described in the agreement",br;
print "Name" ,textfield(-name=>'name'),br, print "Email" ,textfield(-email=>'email'), br;
print "<a href=\"
print "</BODY></HTML>";
print end_html;
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;
}
open (MESSAGE,"| /usr/sbin/sendmail -t");
print MESSAGE "To: myaddress\@comcast.net\n"; @!).
print MESSAGE "From: $FORM{name}, reader\n";
print MESSAGE "Reply-to: $FORM{email}\n";
print MESSAGE "Subject: Feedback from $FORM{testform} \n\n";
print MESSAGE "$FORM{testform} wrote:\n\n";
print MESSAGE "Comment: $FORM{comment}\n\n";
print MESSAGE "Sent by: $FORM{testform} ($FORM{email}).\n";
close (MESSAGE);
&thank_you; #method call
}
sub thank_you {
print <<EndStart;
<html>
<head>
<title>Thank You</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<h1>Thank You</h1>
<hr>
EndStart
print "<blockquote><em>$FORM{comment}</em></blockquote>\n\n";
print <<EndHTML;
</body>
</html>
EndHTML
exit(0);
}
#!/usr/local/bin/perl
read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
}
print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<BODY BGCOLOR=#FFFFFF>\n";
print "<CENTER>\n";
print "JAPANESE WOMEN BOWING IN TRADITIONAL GREETING";
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
print "$fields{name}</BR>";
print "$fields{email}<BR>\n";
use CGI ":all";
$radio_action = param("radio_action");
$option = param("option");
print br, "I have agreed to the tems of sale: ", br,
radio_group(-name=>"radio_action",
-values=>['Yes,'],
-default=>'1',-override=>1);
if ($radio_action eq "Yes, I have agreed to the terms of sale")
{
}
$option = param("option");
print "<CENTER>\n";
print header, start_form,
print "I have read and agree to the terms and conditions described in the agreement",br;
print "Name" ,textfield(-name=>'name'),br, print "Email" ,textfield(-email=>'email'), br;
print "<a href=\"
print "</BODY></HTML>";
print end_html;
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;
}
open (MESSAGE,"| /usr/sbin/sendmail -t");
print MESSAGE "To: myaddress\@comcast.net\n"; @!).
print MESSAGE "From: $FORM{name}, reader\n";
print MESSAGE "Reply-to: $FORM{email}\n";
print MESSAGE "Subject: Feedback from $FORM{testform} \n\n";
print MESSAGE "$FORM{testform} wrote:\n\n";
print MESSAGE "Comment: $FORM{comment}\n\n";
print MESSAGE "Sent by: $FORM{testform} ($FORM{email}).\n";
close (MESSAGE);
&thank_you; #method call
}
sub thank_you {
print <<EndStart;
<html>
<head>
<title>Thank You</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<h1>Thank You</h1>
<hr>
EndStart
print "<blockquote><em>$FORM{comment}</em></blockquote>\n\n";
print <<EndHTML;
</body>
</html>
EndHTML
exit(0);
}