9 Replies Latest reply on Mar 19, 2013 7:34 AM by Fellows12

    php form not including a field in the email sent to me


      I have tried to add a phone field to an existing form on my site, I just duplicated the existing email field and changed to say phone instead. The form works fine except that the  email that comes through to me has all entered data from the form except for the phone field. Help would be great as I am a bit of a newbie.


      Here is the mail.php:





          $name = $_REQUEST['name'] ;

          $email = $_REQUEST['email'] ;

          $phone = $_REQUEST['phone'] ;

          $comments = $_REQUEST['comments'] ;


          $message =




              Name: $name\n

              Email: $email\n

              Phone: $phone\n   

              Comments: $comments




          mail( "removedforprivacy", "Email from my website, sent by $name",

           $message, "From: $email"  );







      Here is the form HTML:


      <form method="post">






                                          <label for="name" id="name_label">Name</label>

                                          <input id="name" type="" value="Your Name" name="name" class="text-input" />

                                          <label class="error" for="name" id="name_error">This field is required.</label>



                                          <label for="email" id="email_label">Email</label>

                                          <input id="email" type="" value="Your Email" name="email" class="text-input" />

                                          <label class="error" for="email" id="email_error">This field is required.</label>



                                          <label for="phone" id="phone_label">Phone</label>

                                          <input id="phone" type="" value="Your Phone" name="phone" class="text-input" />

                                          <label class="error" for="name" id="phone_error">This field is required.</label>



                                          <label for="comments" id="comments_label">Boston Brewery Booking Requested Date</label>

                                          <textarea id="comments" type="" name="comments" class="text-input">Required Date</textarea>

                                          <label class="error" for="comments" id="comments_error">This field is required.</label>



                                          <button type="submit" name="submit" class="send" id="submit_btn" value="Send">Submit</button>