Hi I wrote following form processing script that I got partially to work. everything works (validation and adding name and email to header), but I can't get it to add the content in the body, I have saved all contents in the variable $body here it is:
function VerifyForm(&$values, &$errors)
{
if (strlen($values['name']) < 3)
$errors['name'] = 'Name too short';
elseif (strlen($values['name']) > 40)
$errors['name'] = 'Name too long';
if (!ereg('.*@.*\..{2,4}', $values['email']))
$errors['email'] = 'Email address invalid';
Services selected:\n
$graphic\n\n
products: $products\n
colors: $colors\n
When Would you like to start: $start\n
Project deadline: $deadline\n
Budget: $budget\n
Details/Comments :$comment
";
<form>
all field are here
</form>
</body>
</html>
<?php
}
function ProcessForm($values)
{
mail('myemail@domain.com', "response" , $body, "From: \"{$values['name']}\ <{$values['email']}>");
Services selected:\n
".$graphic."\n\n
products: ".$products."\n
colors: ".$colors."\n
When Would you like to start: ".$start."\n
Project deadline: ".$deadline."\n
Budget: ".$budget."\n
Details/Comments: ".$comment."
";
If you use this, it tells the script to use the variables value as the information.
Bookmarks