j4mes_bond25 Posted July 6, 2006 Share Posted July 6, 2006 After virtually, bending over backwards, I managed to FINALLY got the SMTP e-mail making it possible to actually receive the data entered by viewers in my Contact form. Its code (in .txt) can be seen from: http://members.lycos.co.uk/darsh25/AllInclusiveWebDesign/contact.php.txtActual page can be viewed on: http://members.lycos.co.uk/darsh25/AllInclusiveWebDesign/contact.phpSadly, however, I was only receiving the "message" itself & NOT the "title", "first_name", "last_name", "contact_no.", etc.I realised that I didn't include other field WITHIN php's "mail" function & hence wasn't gettting this on my e-mail (after user submits the form).I've now added "additional parameters" (if I'm right), so as to receive all the required fields. Firstly, I'm unsure if what I've added is right or wrong & secondly, I'm getting some "syntax" error.So, the 1st version of this PHP "mail" code was: [code=php:0](mail("contact@allinclusivewebdesign.byethost13.com", $_POST['inquiry'], stripslashes($_POST['message']), "From: " . $_POST['email']))[/code] The revised version i.e. the one where I've added "additional parameters", so as to receive ALL fields in my e-mail: [code=php:0](mail("contact@allinclusivewebdesign.byethost13.com", $_POST['inquiry'], stripslashes($_POST['message']), ("From: " . $_POST['email']), ("Inquiry: " . $_POST['inquiry']), ("Title: " . $_POST['title']), ("First Name: " . $_POST['first_name']), ("Last Name: " . $_POST['last_name']),("E-mail: " . $_POST['email']),("Phone: " . $_POST['phone']),("Message: " . $_POST['message']),("Reply: " . $_POST['reply']),("Contact: " . $_POST['contact'])) [/code]I wonder, hence, if anyone around could possily check my "updated" code, which is: http://members.lycos.co.uk/darsh25/AllInclusiveWebDesign/contact_updated.php.txtI simply wish to receive ALL the fields data on my e-mail. Quote Link to comment https://forums.phpfreaks.com/topic/13880-php-contact-form/ Share on other sites More sharing options...
kenrbnsn Posted July 6, 2006 Share Posted July 6, 2006 Did you look at the reference manual's description for the mail() function? http://www.php.net/manual/en/function.mail.phpWhere in that description does it mention you can have more than 5 parameters?You need to put that information into the $body:[code]<?php$body = "Inquiry: " . $_POST['inquiry'] . "\n"; $body .= "Title: " . $_POST['title'] . "\n"; $body .= "First Name: " . $_POST['first_name'] . "\n";$body .= "Last Name: " . $_POST['last_name'] . "\n";$body .= "E-mail: " . $_POST['email'] . "\n";$body .= "Phone: " . $_POST['phone'] . "\n";$body .= "Message: " . $_POST['message'] . "\n";$body .= "Reply: " . $_POST['reply']) . "\n";$body .= "Contact: " . $_POST['contact'] . "\n";mail("contact@allinclusivewebdesign.byethost13.com", $_POST['inquiry'], $body, "From: " . $_POST['email']);?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/13880-php-contact-form/#findComment-54071 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.