Hi, I am having problems with my forms emailing the inputted content into my emails. It sends all of the rest of my html such as line breaks and everything that is actually in my php code. But it doesn't pull anything from the form. I have double and triple checked, and everything is spelled correctly and everything...anyway here is the php for the mail function.

<?php

/* Subject and Email Variables */

	$emailSubject = 'Bid Request';
	$webMaster = 'calexteriors@sbcglobal.net';
	
/* Gathering Data Variables */

	$firstField = $_POST['first'];
	$lastField = $_POST['last'];
	$addressField = $_POST['address'];
	$cityField = $_POST['city'];
	$zipcodeField = $_POST['zipcode'];
	$phoneField = $_POST['phone'];
	$faxField = $_POST['fax'];
	$emailField = $_POST['email'];
	$typeField = $_POST['type'];
	$timeField = $_POST['time'];
	$descriptionField = $_POST['description'];
	
	$body = <<<EOD
<br><hr><br>
First Name: $first <br>
Last Name: $last <br>
Address: $address <br>
City: $city <br>
Zip Code: $zipcode <br>
Phone Number: $phone <br>
Fax Number: $fax <br>
Email: $email <br>
Job Type: $type <br>
Time Frame: $time <br>
Job Description: $description <br>
EOD;

	$headers = "From: $email\r\n";
	$headers .= "Content-type: text/html\r\n";
	$success = mail($webMaster, $emailSubject, $body, $headers);
	
/* Results rendered as HTML */

	$theResults = <<<EOD
<html>
<head>
<title>California Exteriors Roofing Contractors, Inc.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	background-color: #f1f1f1;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-style: normal;
	line-height: normal;
	font-weight: normal;
	color: #666666;
	text-decoration: none;
}
-->
</style>
</head>

<div>
  <div align="left">Thank you! We will get back to you soon.  If you do not hear from us within three business days please do not hesitate to call us at 1-800-344-ROOF</div>
</div>
</body>
</html>
EOD;
echo "$theResults";

		
?>

Recommended Answers

All 3 Replies

And here is my html for the form.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Request a Bid</title>
<link href="bid twoColLiqLtHdr.css" rel="stylesheet" type="text/css" />
<!--[if IE]>
<style type="text/css"> 
/* place css fixes for all versions of IE in this conditional comment */
.twoColLiqLtHdr #sidebar1 { padding-top: 30px; }
.twoColLiqLtHdr #mainContent { zoom: 1; padding-top: 15px; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
</style>
<![endif]-->
<style type="text/css">
<!--
.style1 {font-family: Geneva, Arial, Helvetica, sans-serif;
}
-->
</style>









<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<style type="text/css">
<!--
body {
	background-image: url(blue%20sketch.jpg);
}
-->
</style>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>

<body class="twoColLiqLtHdr">


<div id="container"> 
  <div id="header">
    <h1 align="center" class="style1"><a href="index.html"><img src="color banner.jpg" alt="color banner" width="612" height="249" border="0" longdesc="color banner.jpg" /></a>
      <!-- end #header -->
    </h1>
  </div>
  <div id="sidebar1">
    <ul id="MenuBar1" class="MenuBarVertical">
      <li><a href="index.html">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button12','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button12' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="movie" value="button12.swf" />
          <param name="quality" value="high" />
          <embed src="button12.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
      </a> </li>
      <li><a href="about.html" class="MenuBarItemSubmenu">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button13','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button13' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="movie" value="button13.swf" />
          <param name="quality" value="high" />
          <embed src="button13.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
        </a>
          <ul>
            <li><a href="references.html">
              <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button14','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button14' ); //end AC code
      </script>
              <noscript>
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                <param name="movie" value="button14.swf" />
                <param name="quality" value="high" />
                <embed src="button14.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
              </object>
              </noscript>
            </a></li>
          </ul>
      </li>
      <li><a href="services.html">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button15','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button15' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="movie" value="button15.swf" />
          <param name="quality" value="high" />
          <embed src="button15.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
      </a></li>
      <li><a href="commercial.html" class="MenuBarItemSubmenu">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button16','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','bgcolor','','movie','button16' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="BGCOLOR" value="" />
          <param name="movie" value="button16.swf" />
          <param name="quality" value="high" />
          <embed src="button16.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
        </a>
          <ul>
            <li><a href="commercialpics.html">
              <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button18','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button18' ); //end AC code
      </script>
              <noscript>
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                <param name="movie" value="button18.swf" />
                <param name="quality" value="high" />
                <embed src="button18.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
              </object>
              </noscript>
            </a></li>
          </ul>
      </li>
      <li><a href="residential.html" class="MenuBarItemSubmenu">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button17','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button17' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="movie" value="button17.swf" />
          <param name="quality" value="high" />
          <embed src="button17.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
        </a>
          <ul>
            <li><a href="residentialpics.html">
              <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button19','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button19' ); //end AC code
      </script>
              <noscript>
              <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
                <param name="movie" value="button19.swf" />
                <param name="quality" value="high" />
                <embed src="button19.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
              </object>
              </noscript>
            </a></li>
          </ul>
      </li>
      <li><a href="maintenance.html">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button20','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button20' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="movie" value="button20.swf" />
          <param name="quality" value="high" />
          <embed src="button20.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
      </a></li>
      <li><a href="bid.html">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button21','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button21' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="movie" value="button21.swf" />
          <param name="quality" value="high" />
          <embed src="button21.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
      </a></li>
      <li><a href="contact.html">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button22','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button22' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="movie" value="button22.swf" />
          <param name="quality" value="high" />
          <embed src="button22.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
      </a> </li>
      <li><a href="hoa.html">
        <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0','width','100','height','22','src','button23','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','button23' ); //end AC code
    </script>
        <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
          <param name="movie" value="button23.swf" />
          <param name="quality" value="high" />
          <embed src="button23.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed>
        </object>
        </noscript>
      </a></li>
    </ul>
  </div>
  <div id="mainContent">
    <h1 align="justify"> Request a Bid</h1>
    <form id="form1" name="form1" method="post" action="contact form mail.php">
      <table width="100%" border="0" cellpadding="6">
        <tr>
          <td><div align="right">
            <label for="first">First Name:</label>
          </div></td>
          <td><div align="left"><span id="sprytextfield1">
            <input name="first" type="text" id="first" />
          <span class="textfieldRequiredMsg">A value is required.</span></span></div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="last">Last Name:</label>
          </div></td>
          <td><div align="left">
            <input type="text" name="last" id="last" />
          </div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="address">Address:</label>
          </div></td>
          <td><div align="left">
            <input type="text" name="address" id="address" />
          </div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="city">City:</label>
          </div></td>
          <td><div align="left">
            <input type="text" name="city" id="city" />
</div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="zipcode">Zipcode:</label>
          </div></td>
          <td><div align="left">
            <input type="text" name="zipcode" id="zipcode" />
</div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="phone">10-Digit Phone Number:</label>
          </div></td>
          <td><div align="left">
            <input type="text" name="phone" id="phone" />
</div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="fax">Fax:</label>
          </div></td>
          <td><div align="left">
            <input type="text" name="fax" id="fax" />
</div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="email">E-Mail:</label>
          </div></td>
          <td><div align="left">
            <input type="text" name="email" id="email" />
</div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="type">Type of Project:</label>
          </div></td>
          <td><div align="left">
            <select name="type" id="type">
              <option>Please Select</option>
              <option>Commercial</option>
              <option>Residential</option>
              <option>HOA</option>
                        </select>
</div></td>
        </tr>
        <tr>
          <td><div align="right">
            <label for="time">Preferred Time Frame:</label>
          </div></td>
          <td><div align="left">
            <input type="text" name="time" id="time" />
          </div></td>
        </tr>
        <tr>
          <td height="121"><div align="right">
            <label for="description">Brief Project Description:</label>
          </div></td>
          <td><div align="left">
            <textarea name="description" id="description" cols="45" rows="5"></textarea>
</div></td>
        </tr>
        <tr></tr>
        <tr>
          <td height="30"><div align="right">
            <label for="submit"></label>
            <input type="submit" name="submit" id="submit" value="Request Bid" />
          </div></td>
          <td><label for="reset"></label>
          <input type="reset" name="reset" id="reset" value="Reset" /></td>
        </tr>
      </table>
    </form>
    <p align="left">&nbsp;</p>
    <p align="left">&nbsp;</p>
  <!-- end #mainContent --></div>
	<!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --><br class="clearfloat" />
  <div id="footer">
    <!-- end #footer -->
  </div>
<!-- end #container --></div>



<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1");
//-->
</script>
</body>
</html>
Member Avatar for amigura

well i have not reviewed all your code but wat stood out was first bit in php.

when you set $firstField = $_POST;
this should not be
First Name: $first
it should be
First Name: $firstField

$firstField = $_POST['first'];
	$lastField = $_POST['last'];
	$addressField = $_POST['address'];
	$cityField = $_POST['city'];
	$zipcodeField = $_POST['zipcode'];
	$phoneField = $_POST['phone'];
	$faxField = $_POST['fax'];
	$emailField = $_POST['email'];
	$typeField = $_POST['type'];
	$timeField = $_POST['time'];
	$descriptionField = $_POST['description'];
	
	$body = <<<EOD
<br><hr><br>
First Name: $firstField <br>
Last Name: $lastField <br>
Address: $addressField <br>
City: $cityField <br>
Zip Code: $zipcodeField <br>
Phone Number: $phoneField <br>
Fax Number: $faxField <br>
Email: $emailField <br>
Job Type: $typeField <br>
Time Frame: $timeField <br>
Job Description: $descriptionField <br>
EOD;

That worked like a charm! Thank you SOOO much, you saved me from a CONTINUOUS headache!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.