September 18, 201411 yr As the title might suggest, I'm not so hot with PHP, and have decided to try use a PHP contact form on my brother in laws site, I can confirm this to be true. As it stands, the Form is posting, but only one variable seems to be sent correctly from the form to the PHP mailing code, so all I see in the test emails are: Name: Email Address: Phone Number: Subject: The subject is working... Message: The code was taken from a basic enough example on a website. Here is the form table: http://pastebin.com/FN5z1RAm And here is the 'send-email.php' http://pastebin.com/qkpip4Z5 As I said.. the 'subject' field is the only one that works, so I'd love to hear how dopey im being Thanks a lot guys.
September 18, 201411 yr In line 16 the variable for the Full Name field is set to $name $name = $_POST['fullname']; // required In line 29 you validate $name if(!preg_match($string_exp,$name)) { However in line 47 you use $fullname $email_message .= "Name: ".clean_string($fullname)."\n"; Try using $email_message .= "Name: ".clean_string($name)."\n"; as line 47
September 18, 201411 yr No probs. Glad it was an easy one. Actually it is quite a simple yet common error to make and I dare say we've all done it and will continue to do it now and again.
September 19, 201411 yr No probs. Glad it was an easy one. Actually it is quite a simple yet common error to make and I dare say we've all done it and will continue to do it now and again. Guilty! I find I end up writing down the form field names whilst developing helps prevent this sort of thing
Create an account or sign in to comment