December 11, 200817 yr Hi All, I have the following two sets of code, the email send to my inbox but nothing is displayed on what the user has inputted. What have I done wrong ?? HTML Form Code: <form method="post" action="test1.php"> Name: <input name="nameField" type="text" size="25" />*<br /> <br /> Email: <input name="emailField" type="text" size="25" />*<br /> <br /> Phone: <input name="phoneField" type="text" size="25" /><br /> <br /> Type your message in the box below - *Required<br /> <textarea name="Body" cols="30" rows="5"></textarea><br /> <input name="Submit1" type="submit" value="Send" /> <input name="Reset1" type="reset" value="Reset" /> </form> PHP Process Code: <?php /*Subject & Email Variables*/ $emailSubject = 'Website Form Feedback'; $webMaster = 'email@domain.com'; /*Gathering Variables*/ $emailField = $_POST['email']; $nameField = $_POST['name']; $phoneField = $_POST['phone']; $commentsField = $_POST['comments']; $body = <<<EOD <br><br> Name: $name <br> Email: $email <br> Phone: $phone <br> Comments/Message: $comments <br><hr><br> EOD; /*Headers of the email*/ $headers = "From: $email\r\n"; $headers .="Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /*If email sent this variable will show*/ $theResults = <<<EOD <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> </style> </head> <body> <p>Thank you.</p> </body> </html> EOD; echo "$theResults"; ?> Be gentle still learning, so has much info on what I have done wrong in plain english will be helpful. Cheers.
December 11, 200817 yr lol... ok $emailField is the variable that you put $_POST['email'] to... now look at the email message code... do you use $emailField or do you use $email? hope you pick up on that
December 11, 200817 yr Author Hi, Thanks, I have just picked up on that waiting for a reply on here lol So just testing it now. Thanks again
December 11, 200817 yr Author Ok all works fine now!!! sorted it didnt realise i had different name variables....
December 18, 200817 yr "Type your message in the box below - *Required<br />" The script you posted doesn't require anything unless you use $_REQUIRE.
Create an account or sign in to comment