smordue Posted December 18, 2009 Share Posted December 18, 2009 I am using the following code for my formhandler: <?php $email = $POST[email]; $mailto = "[email protected]"; $mailsubj = "Website Contact Form submission"; $mailhead = "From: $email\n"; reset ($HTTP_POST_VARS); $mailbody = "Values submitted from web site contact form:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } if (!eregi("\n",$POST[email])) { mail($mailto, $mailsubj, $mailbody, $mailhead); } ?> Instead of emailing all of the values, I would like this to only send: name, message, phone and email Thanks for your help! Steve Link to comment https://forums.phpfreaks.com/topic/185602-limit-sent-variables/ Share on other sites More sharing options...
cytech Posted December 18, 2009 Share Posted December 18, 2009 $mailbody .= "Name: ".$_POST['name']."\n"; $mailbody .= "Message: ".$_POST['message']."\n"; $mailbody .= "Phone: ".$_POST['phone']."\n"; $mailbody .= "Email: ".$_POST['email']; Link to comment https://forums.phpfreaks.com/topic/185602-limit-sent-variables/#findComment-979926 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.