Hi All,
I’m just trying to finish off a contact form and have got stuck on one element. In the body of the text that is sent to the person I would like the the ‘reference’ and ‘name’ fields mentioned at a particular point ( where it says, What do i put here?). Could some one let me know the code that would need to be added? Let me know if additional information is required.
Many thanks,
Keith
[php]
<?php $from = $_REQUEST['Email'] ; $name = $_REQUEST['Surname'] ; $Reference = $_REQUEST['Reference'] ; $Forname = $_REQUEST['Christian-name'] ; $Institution = $_REQUEST['Institution'] ; $Street = $_REQUEST['Street'] ; $Town = $_REQUEST['Town'] ; $Post = $_REQUEST['Post-code'] ; $country = $_REQUEST['country'] ; $Telephone = $_REQUEST['Telephone'] ; $headers = "From: $from"; $subject = "Web Contact Data"; $fields = array(); $fields{"Reference"} = "Reference"; $fields{"Name"} = "Surname"; $fields{"Christian-name"} = "Christian-name"; $fields{"Institution"} = "Institution"; $fields{"Street"} = "Street"; $fields{"Town"} = "Town"; $fields{"Post-code"} = "Post-code"; $fields{"country"} = "country"; $fields{"Telephone"} = "Telephone"; $fields{"Email"} = "Email"; $to = "[email protected]"; $body = "blah blah details:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: [email protected]"; $subject2 = "blah blah"; $autoreply = " Thank you for registering with tblah blah. Please use your unique reference code attached below when making your booking. http://www.blahblah.html your name: (what do i put here?) reference: (what do i put here?) ------------------------------------------- http://www.blahblah.org Tel: + F: + E: infg Disclaimer This e-mail is confidential and intended for the addressee (s) only. It may also be privileged. If you are not the intended recipient, please notify the sender by replying to this e-mail. You should not copy this e-mail or otherwise use it for any purpose and the contents must not be disclosed to any other person."; if($from == '') {echo "You have not entered an email, please go back and try again";} else { if($name == '') {echo "You have not entered a name, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) {header( "Location: http://blahblah.co.uk/thankyou.html" );} else {echo "We encountered an error sending your mail, please notify [email protected]"; } } } ?> <?php $headers = "From:[email protected]\r\n"; $recipients = "[email protected],[email protected]"; mail($recipients, "This is the subject","This is the mail body", $headers); ?>[/php]