Quote:
Originally Posted by stevon Here is a php script that will send any form information to an e-mail address Code: if ($_SERVER['REQUEST_METHOD'] != "POST"){exit;}
$message = "";
while(list($key,$value) = each($_POST)){if(!(empty($value))){$set=1;}$message = $message . "$key: $value\n\n";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;}
$message = stripslashes($message);
$to = "yourmail@yourdomain.com";
$subject = "Your Subject";
if (mail($to, $subject, $message))
{
echo("<h1>Thank You</h1>");
} |
Thanks stevon but have another question...
How do we email multiple fields using PHP?
For example, in here mail($to, $subject, $message), you are only allowed one variable: $message. What if your form contains, say, 4 variables that need to be emailed.