PHP - Form Mail Help for a rookie
Posted: Thu Jun 02, 2005 10:20 am
I need help with the below script. 2 things I need;
1) I need this script to check whether there is data in a field before adding that field to the message (considering using an if else on it after it pulls the content but before it adds to message)
2) I need to know how to use this script to also add values from a form select field
1) I need this script to check whether there is data in a field before adding that field to the message (considering using an if else on it after it pulls the content but before it adds to message)
2) I need to know how to use this script to also add values from a form select field
Code: Select all
<?php
foreach ($_POST as $Field=>$Value)
$MsgBody .= "$Field: $Value\n";
$MsgBody .= "$Divider\n" . $_SERVER["HTTP_USER_AGENT"] . "\n";
$MsgBody = htmlspecialchars($MsgBody); //make content safe
?>