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

    Quick help with form mailer

    jrandazzo1984 Community Member

      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:

       

       

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

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

            <tr>

              <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>

            </tr>

            <tr>

              <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>

            </tr>

            <tr>

              <td>Main Category<br />

                <select name="Main Category">

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

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

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

                </select>

      </td>

              <td>Sub Category:

        <br />

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

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

            </tr>

            <tr>

            </table>

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

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

       

       

      </h3>

              </p>

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

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

          </form>

       

       

       

      .php file

       

       

      <?php

       

       

      /* 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'];

      $copy_photo[0]="";

       

       

       

       

       

       

      $body = <<<EOD

      <br><hr><br>

      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>

       

       

      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>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;

      }

       

       

       

       

      -->

      </style>

      </head>

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

      </div>

      </body>

      </html>

      EOD;

      echo "$theResults";

      ?>

       

       

       

       

       

      Any help would be greatly greatly appreciated!