9 Replies Latest reply on May 6, 2012 10:19 AM by BcSurvivor08

    Quick help with form mailer

    jrandazzo1984 Level 1

      I just finished creating my form and .php file to mail it to an email address. All the input fields are working properly, except one. I can not get a drop down (Main Category) submission field to email me the submission. The form works fine on the website, the email leaves that one field blank. Any help in my coding would be greatly appreciated.






      <form action="merchantsignup.php" method="post" id="contact_form">

          <center><table width="637" border="0">


              <td>Business Name:

        <br />

          <input type="text" name="name" /></td>

              <td>Business Phone:

        <br />

          <input type="text" name="phone" /></td>

              <td>Business Email:

        <br />

          <input type="text" name="email" /></td>



              <td>Business Address:

        <br />

          <input type="text" name="address" /></td>

              <td>City & Zip:

        <br />

          <input type="text" name="city/zip" /></td>

              <td>Business Webpage:

        <br />

          <input type="text" name="webpage" /></td>



              <td>Main Category<br />

                <select name="Main Category">

                <option value="Food">Food</option>

          <option value="Soda">Soda</option>

                <option value="Candy">Candy</option>



              <td>Sub Category:

        <br />

          <input type="text" name="category2" /></td>

              <td><p> </p></td>




              <td><p>About the Business: <br />

                <textarea cols="88" rows="8" name="about"></textarea>





              <p><input type="submit" name="submit" value="Send" />

        <input type="reset" name="reset" value="Clear Form" /></p>





      .php file






      /* Email Variables */



      $emailSubject = 'Merchant Signup';

      $webMaster = 'info@lf.com';





      /* Data Variables */



      $name = $_POST['name'];

      $phone = $_POST['phone'];

      $email = $_POST['email'];

      $address = $_POST['address'];

      $city = $_POST['city/zip'];

      $webpage = $_POST['webpage'];

      $main_category = $_POST['main'];

      $category2 = $_POST['category2'];

      $about = $_POST['about'];








      $body = <<<EOD


      Name: $name <br>

      Phone: $phone <br>

      Email: $email <br>

      Address: $address <br>

      City: $city <br>

      Wegpage: $webpage <br>

      Main Category: $Main <br>

      Category2: $category2 <br>

      About: $about <br>




      $headers = "From: $email\r\n";

      $headers .= "Content-type: text/html\r\n";

      $success = mail($webMaster, $emailSubject, $body,






      /* Results rendered as HTML */



      $theResults = <<<EOD



      <title>sent message</title>

      <meta http-equiv="refresh" content="3;URL=http://lf.com/index.shtml">

      <style type="text/css">


      body {

      background-color: #000;

      font-family: Verdana, Arial, Helvetica, sans-serif;

      font-size: 20px;

      font-style: normal;

      line-height: normal;

      font-weight: normal;

      color: #FF0000;

      text-decoration: none;

      padding-top: 400px;

      margin-left: 250px;

      width: 800px;









      <div align="center"> Thank you for submitting your information! You will recieve an email from us shortly! </div>





      echo "$theResults";







      Any help would be greatly greatly appreciated!