Skip to main content
April 27, 2010
질문

My form data (sent to an email address) is not showing up in the body of the email message.

  • April 27, 2010
  • 1 답변
  • 839 조회

I am using a plain html contact form, which redirects to a thankyou.php page to process the data. Below is the script from the html page.


<form id="contact" name="contact" method="post" enctype="text/plain" action="thankyou.php">


The following is the php script I am using to process the data.

<script language="php">
$email = $HTTP_POST_VARS[email];
$mailto = "email@address";
$mailsubj = "Form submission";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; }
if (!eregi("\n",$HTTP_POST_VARS[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); }
</script>


In the email, I receive the subject line "Form submission", and in the body the message "Values submitted from web site form". The problem is that none of the values/text fields information shows up. I am using Dreamweaver CS3 and my OS is Windows 7 Pro.

이 주제는 답변이 닫혔습니다.

1 답변

Participating Frequently
April 28, 2010

If you echo the $key, $val is anything displayed ?

Remove enctype="text/plain" from your form tag.

HTH

-Rob B

April 30, 2010

I tried the echo of the $key and $val. It did display who the email was from, which it didn't before. There still is no information in the body of the message (from form fields).