xochi Posted January 22, 2011 Share Posted January 22, 2011 hi, I'm a newb. barely getting my feet wet in php after years of wanting to. I wrote this script following a youtube tutorial and it all made sense as I coded it.... so as far as I'm familiar with the little bit of coding, my script should work. actually it works. I get an email but with no data??? I can't get the script to gather the info and send it along with the email. not sure why as all seems in place.any help here would be greatly appreciated. thank you. here is the script... <?php /*subject and email variables */ $emailSubject = 'edson vehicle order form'; $webMaster = '[email protected]'; /*gathering data variables*/ $modelyear = $_POST['modelyear']; $vehiclemake = $_POST['vehiclemake']; $vehiclemodel = $_POST['vehiclemodel']; $colors = $_POST['colors']; $notcolors = $_POST['notcolors']; $options = $_POST['options']; $descriptions = $_POST['descriptions']; $tradeinyear = $_POST['tradeinyear']; $tradeinmake = $_POST['tradeinmake']; $tradeinmodel = $_POST['tradeinmodel']; $miles = $_POST['miles']; $tradeincolor = $_POST['tradeincolor']; $conditionofcar = $_POST['conditionofcar']; $damage = $_POST['damage']; $lienholder = $_POST['lienholder']; $name = $_POST['name']; $homephone = $_POST['homephone']; $workphone = $_POST['workphone']; $cellphone = $_POST['cellphone']; $besttimetoreach = $_POST['besttimetoreach']; $bestwaytocontact = $_POST['bestwaytocontact']; $paymenttype = $_POST['paymenttype']; $howdidyoulocateus = $_POST['howdidyoulocateus']; $pickuptime = $_POST['pickuptime']; $comments = $_POST['comments']; $body - <<<EOD <br><hr><br> Model year: $modelyear <br> Vehicle make: $vehiclemake <br> Vehicle model: $vehiclemodel <br> Vehicle colors: $colors <br> Colors not considered: $notcolors <br> Options desired: $options <br> Descriptions: $descriptions <br> Trade in year: $tradeinyear <br> Trade in make: $tradeinmake <br> Trade in model: $tradeinmodel <br> miles: $miles <br> Trade in color: $tradeincolor <br> Condition of car: $conditionofcar <br> Damage: $damage <br> Lienholder: $lienholder <br> Name: $name <br> Home phone: $homephone <br> Work phone: $workphone <br> Cell phone: $cellphone <br> Best time to reach: $besttimetoreach <br> Best way to contact: $bestwaytocontact <br> Payment type: $paymenttype <br> How did you locate us: $howdidyoulocateus <br> Pick up time: $pickuptime <br> Comments: $comments <br> EOD; $headers = "From $name\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headrers); /* results rendered as html */ $theResults = <<<EOD <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Edson Vehicle Remarketing</title> <style type="text/css"> body { background-color: #000; background-image: url(); background-repeat: repeat-x; margin-bottom: 0px; } .orderform { left: auto; right: auto; margin-top: 25px; } #htmlforphp { width: auto; height: 300px; text-align: center; padding-top: 250px; padding-right: 50px; font-size: 20px; } </style> <link href="css/layout.css" rel="stylesheet" type="text/css" /> <style type="text/css"> a:link { text-decoration: none; color: #000; } a:visited { text-decoration: none; color: #000; } a:hover { text-decoration: none; color: #333; } a:active { text-decoration: none; color: #666; } #wrapper #bodyArea .orderform { padding-left: 100px; padding-right: 100px; position: relative; color: #999; } </style> </head> <body> <div id="wrapper"> <div id="logo"><img src="images/banner.gif" width="800" height="110" alt="edson vehicle remarketing" /></div> <div id="navigation"><strong><a href="index.html">HOME</a> | <a href="inventory.html">INVENTORY</a> | <a href="financing.php">FINANCING</a> | <a href="orderform.html">ORDER FORM</a> | <a href="directions.html">DIRECTIONS</a> | <a href="contactus.html">CONTACT US</a></strong></div> <div id="bodyArea"> <div id="htmlforphp">Thank you for your interest.<br />Edson vehicle remarketinng will find you the best car possible!</div> </div> <div id="footer"><a href="index.html">home</a> | <a href="inventory.html">inventory</a> | <a href="financing.php">financing</a> | <a href="orderform.html">order form</a> | <a href="directions.html">directions</a> | <a href="contactus.html">contact us</a></div> </div> </body> </html> EOD; echo "$theResults"; ?> Link to comment https://forums.phpfreaks.com/topic/225346-help-with-form-mailer-script-please/ Share on other sites More sharing options...
pepsimax123 Posted January 22, 2011 Share Posted January 22, 2011 Your $body is followed by a hyphen rather than an '=' sign. Link to comment https://forums.phpfreaks.com/topic/225346-help-with-form-mailer-script-please/#findComment-1163724 Share on other sites More sharing options...
xochi Posted January 22, 2011 Author Share Posted January 22, 2011 wow! ok...this goes to show that one sometimes needs a second eye at things. I read and re read the code for days and I swear never once did I notice that. such a simple mistake...thank you soo much pepsimax. you just helped me have peace of mind through the weekend. Link to comment https://forums.phpfreaks.com/topic/225346-help-with-form-mailer-script-please/#findComment-1163726 Share on other sites More sharing options...
kittrellbj Posted January 22, 2011 Share Posted January 22, 2011 On this line: $success = mail($webMaster, $emailSubject, $body, $headrers); Change "headrers" to "headers" and see if that helps. Link to comment https://forums.phpfreaks.com/topic/225346-help-with-form-mailer-script-please/#findComment-1163727 Share on other sites More sharing options...
xochi Posted January 22, 2011 Author Share Posted January 22, 2011 oh thanks kitt..another thing i didn't notice. will change that.. Link to comment https://forums.phpfreaks.com/topic/225346-help-with-form-mailer-script-please/#findComment-1163734 Share on other sites More sharing options...
xochi Posted January 22, 2011 Author Share Posted January 22, 2011 everything worked perfect, thank you so much for all the help. Link to comment https://forums.phpfreaks.com/topic/225346-help-with-form-mailer-script-please/#findComment-1163740 Share on other sites More sharing options...
kittrellbj Posted January 22, 2011 Share Posted January 22, 2011 Not a problem. Please mark as solved so others will know. Link to comment https://forums.phpfreaks.com/topic/225346-help-with-form-mailer-script-please/#findComment-1163742 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.