Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Guest
Apr 27, 2010 Apr 27, 2010

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.

TOPICS
Server side applications
838
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 28, 2010 Apr 28, 2010

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

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

HTH

-Rob B

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 29, 2010 Apr 29, 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).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 29, 2010 Apr 29, 2010
LATEST

I didn't have to echo the $key and $val. All I had to do was remove the enctype="text/plain" from the form tag. Everything works great now. Thank you very much for your help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines