I realise this may have been covered many times before but I am very new to php and can't seem to find what I am looking for in the forum. Basically I am calling mail.php from my form. The form is very simple and has only 4 fields, Name, Email, Telephone and Comments. My hosting company sent me the following mail.php to use but I don't know how to include the form fields:
<?
$to = ' me@mydomain.com';
$subject = 'Web Enquiry';
$message = 'From: ' . $_REQUEST['Name'] . "\n\n" . $_REQUEST['Comments'];
$email = $_REQUEST['Email'];
$headers = 'From: ' . $email . "\r\n" .
'Reply-To: ' . $email . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail ($to, $subject, $message, $headers);
header("Location: index.htm");
?>
Once submitted (obviously changing the e-mail address) I duly receive an e-mail containing from, Name and comments. How do I add further fields such as Telephone etc? Also, the redirect doesn't work? I was told that after submission, the user would be redirected to the home page?
Your answers are much appreciated
Kevin