dgow13 Posted March 23, 2013 Report Posted March 23, 2013 (edited) I have an email form that I have used for awhile. The php process page sends the form data to whoever is listed in the webmaster email. It work fine. I need to add a confirmation email within the script so that whoever fills out the form. Any suggestions? Here is the register.process.php script. <?php /* subject & email veriables */ $webMaster = 'dgow@simplewebs13.com'; /* date veriables */ $name = $_REQUEST['name']; $email = $_REQUEST['email']; $phone = $_REQUEST['phone']; $interest = $_REQUEST['interest']; $date = $_REQUEST['date']; $message = $_REQUEST['message']; $body = <<<EOD <table width="500"> <tr><td> Class Registration Submission Form <td><tr> </table> <br><hr><br> <table width="500"> <tr><td style="width: 160px"/>Full Name:<td/>$name </tr> <tr><td style="width: 160px"/>Email:<td/>$email </tr> <tr><td style="width: 160px"/>Phone Number:<td/>$phone <tr/> <tr><td style="width: 160px"/>Class Registration:<td/>$interest <tr/> <tr><td style="width: 160px"/>Class Date:<td/>$date <tr/> <tr><td style="width: 160px"/>Special Instructions:<td/>$message <tr/> </table> <br><hr><br> <table width="500"> <tr><td> <font style="font-family: Arial, Helvetica, sans-serif; font-size: x-small; color: gray; ">© Copyright 2013 - <a href="http://company.com">company.</a> All Rights Reserved.</font> <td><tr> </table> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $interest, $body, $headers); include ('register.success.php'); ?> Edited March 23, 2013 by dgow13 Quote
falkencreative Posted March 23, 2013 Report Posted March 23, 2013 Sorry, is this a question? Comment? Quote
dgow13 Posted March 23, 2013 Author Report Posted March 23, 2013 Sorry, is this a question? Comment? I actually left out the question, sorry. Need help adding the confirmation email to this script. Quote
dgow13 Posted March 23, 2013 Author Report Posted March 23, 2013 (edited) Fixed it. I added $email = '$email'; to the top of the form and $success = mail($email, $interest, $body, $headers); to the bottom. <?php /* subject & email veriables */ $webMaster = 'dgow@simplewebs13.com'; $email = '$email'; /* date veriables */ $name = $_REQUEST['name']; $email = $_REQUEST['email']; $phone = $_REQUEST['phone']; $interest = $_REQUEST['interest']; $date = $_REQUEST['date']; $message = $_REQUEST['message']; $body = <<<EOD <table width="500"> <tr><td> Point Blank CHL Class Registration Confirmation <td><tr> </table> <br><hr><br> <table width="500"> <tr><td style="width: 160px"/>Full Name:<td/>$name </tr> <tr><td style="width: 160px"/>Email:<td/>$email </tr> <tr><td style="width: 160px"/>Phone Number:<td/>$phone <tr/> <tr><td style="width: 160px"/>Class Registration:<td/>$interest <tr/> <tr><td style="width: 160px"/>Class Date:<td/>$date <tr/> <tr><td style="width: 160px"/>Special Instructions:<td/>$message <tr/> </table> <br><hr><br> <table width="500"> <tr><td> <font style="font-family: Arial, Helvetica, sans-serif; font-size: x-small; color: gray; ">© Copyright 2013 - <a href="http://company.com">company.</a> All Rights Reserved.</font> <td><tr> </table> EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $interest, $body, $headers); $success = mail($email, $interest, $body, $headers); include ('register.success.php'); ?> Edited March 23, 2013 by dgow13 Quote
Guest noahwilson Posted March 30, 2013 Report Posted March 30, 2013 Thanks to share a useful script, really that was need of me. thank a lot to share. Quote
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.
Note: Your post will require moderator approval before it will be visible.