maverick4546
01-13-2010, 11:01 PM
Hi all... and firstly let me apologise for my newbieness :o
I am building a site for a friend at www.oldcastlehotel.co.uk
I have built a form (basic but all thats needed)
when it comes to the form handler I have a file called mail.php which the enquire.htm file calls on when the form is submitted.
this is the original form..
<?
$to = 'me@mydomain.com';
$subject = 'subject';
$message = 'From: ' . $_REQUEST['name'] . "\n\n" . $_REQUEST['data'];
$email = $_REQUEST['email'];
$headers = 'From: ' . $email . "\r\n" .
'Reply-To: ' . $email . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail ($to, $subject, $message, $headers);
header("Location: thanks.html");
?>
When this script is used the form works ok but not all the fields on the form are emailed.. all I get is the name, email and the first option.
All I want to do is add the form fields which are data1, data2, data3 and data4 to the php side and I am struggling a bit.
I am new to php... but wanna learn. Any help from anyone? please!
John
I am building a site for a friend at www.oldcastlehotel.co.uk
I have built a form (basic but all thats needed)
when it comes to the form handler I have a file called mail.php which the enquire.htm file calls on when the form is submitted.
this is the original form..
<?
$to = 'me@mydomain.com';
$subject = 'subject';
$message = 'From: ' . $_REQUEST['name'] . "\n\n" . $_REQUEST['data'];
$email = $_REQUEST['email'];
$headers = 'From: ' . $email . "\r\n" .
'Reply-To: ' . $email . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail ($to, $subject, $message, $headers);
header("Location: thanks.html");
?>
When this script is used the form works ok but not all the fields on the form are emailed.. all I get is the name, email and the first option.
All I want to do is add the form fields which are data1, data2, data3 and data4 to the php side and I am struggling a bit.
I am new to php... but wanna learn. Any help from anyone? please!
John