Jump to content

help with form mailer script please


xochi

Recommended Posts

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 = 'order@edsonvehicleremarketing.com';

 

/*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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.