8 Replies Latest reply on Nov 28, 2012 4:07 PM by MorticiaAZ

    php form post  script

    MorticiaAZ

      I created a form however the instuctions I followed for creating the PHP doc that gathers the information and emails it to me ony reads text fields. I need help with all the other types of  form content such as Pull down menus and check boxes

       

      Here is the code on my php that gathers the text field into.

      thank you in advance.

      Abigail

       

      $email = $_POST['email'];

      $name = $_POST['name'];

      $phone = $_POST['phone'];

      $session_date = $_POST['session_date'];

      $session_time = $_POST['session_time'];

      $session_lenght = $_POST['session_lenght'];

      $references = $_POST['references'];

      $discribe_your_session = $_POST['discribe_your_session'];

       

       

      $body = <<<EOD

      <br><hr><br>

      Name: $name <br>

      Email: $email <br>

      Phone: $phone <br>

      Email: $email <br>

      Session Date:  $session_date <br>

      Session Time:  $session_time <br>

      Sessiion Length: $session_lenght <br>

      References: $references <br>

      Discribe Your Session:  $discribe_your_session <br>

        • 1. Re: php form post  script
          MurraySummers Level 8

          Let's see the HTML too, please.

          • 2. Re: php form post  script
            MorticiaAZ Level 1

            HTML form  section

             

             

            </div>

                    <div id="Form_001">

                      <form name="form1" method="post" action="http://www.transsexualsisters.com/submitform.php">

                        <table width="550" border="10" cellspacing="10" cellpadding="5">

                          <tr>

                            <td width="232"><div align="right">

                              <label for="name">Name:</label>

                              <input type="text" name="name" id="name">

                            </div></td>

                            <td width="257"><div align="left">

                              <label for="session_date">Session Date:</label>

                              <input type="text" name="session_date" id="session_date">

                            </div></td>

                          </tr>

                          <tr>

                            <td><div align="right">

                              <label for="email">Email:</label>

                              <input type="text" name="email" id="email">

                            </div></td>

                            <td><div align="left">

                              <label for="session_time">Session Time:</label>

                              <input type="text" name="session_time" id="session_time">

                            </div></td>

                          </tr>

                          <tr>

                            <td><div align="right">

                              <label for="phone">Phone:</label>

                              <input type="text" name="phone" id="phone">

                            </div></td>

                            <td><div align="left">

                              <label for="session_length">Sessiion Length:</label>

                              <select name="session_length" id="session_length">

                                <option value="1_hour">1 hour</option>

                                <option value="2_hours">2 hours</option>

                                <option value="3_hours">3 hours</option>

                                <option value="4_hours">4 hours</option>

                                <option value="8_hours">8 hours</option>

                                <option value="12_hours">12 hours</option>

                              </select>

                            </div></td>

                          </tr>

                          <tr>

                            <td colspan="2"><label for="references">

                              <div align="left">References:</div>

                            </label>

                              <div align="left">

                                <textarea name="references" id="references" cols="70" rows="2"></textarea>

                            </div></td>

                          </tr>

                          <tr>

                            <td colspan="2"><div align="left">

                              <label for="discribe_your_session">Discribe Your Session:</label>

                              <textarea name="discribe_your_session" id="discribe_ your_session" cols="70" rows="5"></textarea>

                            </div></td>

                          </tr>

                          <tr>

                            <td colspan="2"><div align="right"></div>                  <div align="left"></div></td>

                          </tr>

                          <tr>

                            <td colspan="2"><div align="right">

                              <input type="submit" name="submit" id="submit" value="Submit">

                            </div></td>

                          </tr>

                        </table>

                      </form>

                      <p> </p>

                      <p> </p>

                    </div>

                  </div>

            • 3. Re: php form post  script
              MorticiaAZ Level 1

              php file

               

              <?php

               

              /* Email Variables */

               

              $emailSubject = 'submitform!';

              $webMaster = 'worship@transsexualsisters.com, ladygianna@ymail.com, mistress@kountessa.com';

               

               

              /* Data Variables */

               

              $email = $_POST['email'];

              $name = $_POST['name'];

              $phone = $_POST['phone'];

              $session_date = $_POST['session_date'];

              $session_time = $_POST['session_time'];

              $session_lenght = $_POST['session_lenght'];

              $references = $_POST['references'];

              $discribe_your_session = $_POST['discribe_your_session'];

               

               

               

               

              $body = <<<EOD

              <br><hr><br>

              Name: $name <br>

              Email: $email <br>

              Phone: $phone <br>

              Email: $email <br>

              Session Date:  $session_date <br>

              Session Time:  $session_time <br>

              Sessiion Length: $session_lenght <br>

              References: $references <br>

              Discribe Your Session:  $discribe_your_session <br>

               

               

               

              Comments: $comments <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://www.transsexualsisters.com/Pages/Form.html">

              <style type="text/css">

              <!--

              body {

              background-color: #000;

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

              font-size: 24px;

              font-style: normal;

              line-height: normal;

              font-weight: normal;

              color: #ffffff;

              text-decoration: none;

              padding-top: 200px;

              margin-left: auto;

              margin-right: auto;

              width: 800px;

              }

               

              -->

              </style>

              </head>

              <div align="center">Your email will be answered soon as possible!<br>

              You will return to The Sisters in a few seconds !</div>

              </div>

              </body>

              </html>

              EOD;

              echo "$theResults";

              ?>

              • 4. Re: php form post  script
                bregent Most Valuable Participant

                You have a typo:

                 

                $session_lenght = $_POST['session_lenght'];

                 

                should be

                 

                $session_lenght = $_POST['session_length'];

                • 5. Re: php form post  script
                  MorticiaAZ Level 1

                  DOH!!!

                  • 6. Re: php form post  script
                    bregent Most Valuable Participant

                    Another typo:

                     

                    DOH!!!

                     

                    should be

                     

                    D'OH!!! 

                    • 7. Re: php form post  script
                      MorticiaAZ Level 1

                      OMG thank you so much. I do not know how many hours I wasted over one letter. Just crazy

                      • 8. Re: php form post  script
                        MorticiaAZ Level 1

                        LOL

                        That's great.

                        Thnks for all your help

                        So happy I can come here when I am stuck.

                        hugs

                        Abigail.