Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
If you echo the $key, $val is anything displayed ?
Remove enctype="text/plain" from your form tag.
HTH
-Rob B
Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now