Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help With required fields

    I need help making name phone and email required have tried everything please help.

    PHP Code:
     <?PHP 
    $to 
    "";  
    $subject "Results from your Request Info form";
    $headers "From: Tampabaychartering.net";
    $forward 0;
    $location "";

    $date date ("l, F jS, Y"); 
    $time date ("h:i A"); 


    $msg "Below is the result of your feedback form. It was submitted on $date at $time.\n\n"

    if (
    $_SERVER['REQUEST_METHOD'] == "POST") {
        foreach (
    $_POST as $key => $value) { 
            
    $msg .= ucfirst ($key) ." : "$value "\n"
        }
    }
    else {
        foreach (
    $_GET as $key => $value) { 
            
    $msg .= ucfirst ($key) ." : "$value "\n"
        }
    }

    mail($to$subject$msg$headers); 
    if (
    $forward == 1) { 
        
    header ("Location:$location"); 



    else { 
    header("Location: http://www.tampabaychartering.com/booking.html");
    exit ();

    }

    ?>

    <hr>
    <form action="booking.php" method="post" name="ContactForm" onsubmit="return ValidateContactForm();">


      <p align="left">
      <b><font face="Comic Sans MS" size="4" color="#003366">Type of Charter&nbsp;
      <select size="1" name="type_of_charter">
      <option selected>Flats Fishing</option>

      <option>Inshore Fishing</option>
      <option>Offshore Fishing</option>
      </select></font></b></p>
          
      <p align="left">
      <b><font face="Comic Sans MS" size="4" color="#003366">Have you fished with me 
      before?
      <select size="1" name="have_fished_with_you_before">
        <option>yes</option>

        <option selected>no</option>
      </select></font></b></p>

    <p align="left"><font face="Comic Sans MS" size="4" color="#003366"><b>How
      many days do you want to fish? </b></font><b>
      <font face="Comic Sans MS" size="4" color="#003366">
      <select size="1" name="days_you_want_to_fish">
        <option selected>1</option>
        <option>2</option>
        <option>3</option>

        <option>4</option>
        <option>5</option>
      </select>&nbsp;</font></b></p>
      <p align="left"><b><font color="#003366" size="4" face="Comic Sans MS">How 
      Long of a trip do you want
      <select size="1" name="how_long_do_you_want_to_fish">
      <option selected>Full Day Flats  $450</option>
      <option>Full Day Inshore  $450</option>
      <option>Full Day Offshore  $650</option>

     
      </select></font></b></p>

      <p align="left"><b><font face="Comic Sans MS" size="4" color="#003366">How 
      many people in your party? For parties of more than 4 please call before booking.<select size="1" name="how_many_people">
      <option>1</option>
      <option selected>2</option>
      <option>3</option>
      <option>4</option>
      </select></font></b></p>

      
      <p align="left" style="margin-top:">
      <b><font face="Comic Sans MS" size="4" color="#003366">How many adults? 
      <select size="1" name="adults_in_group">
      <option selected>1</option>

      <option>2</option>
      <option>3</option>
      <option>4</option>


      </select> How Many children under 12? <select size="1" name="number_of_children">
      <option>0</option>
      <option>1</option>
      <option>2</option>
      <option>3</option>
      
      </select></font></b></p>
      <p align="left"><b><font color="#003366" size="4" face="Comic Sans MS">Choose
      the date Of your Charter.</font></b></p>
      <p align="left"><b><font color="#003366" face="Comic Sans MS" size="4">
      <select size="1" name="Charter_Date">
        <option selected>January</option>
        <option>February</option>

        <option>March</option>
        <option>April</option>
        <option>May</option>
        <option>June</option>
        <option>July</option>
        <option>August</option>

        <option>September</option>
        <option>October</option>
        <option>November</option>
        <option>December</option>
      </select>&nbsp;&nbsp;
      <select size="1" name="day">
        <option selected>1</option>

        <option>2</option>
        <option>3</option>
        <option>4</option>
        <option>5</option>
        <option>6</option>
        <option>7</option>

        <option>8</option>
        <option>9</option>
        <option>10</option>
        <option>11</option>
        <option>12</option>
        <option>13</option>

        <option>14</option>
        <option>15</option>
        <option>16</option>
        <option>17</option>
        <option>18</option>
        <option>19</option>

        <option>20</option>
        <option>21</option>
        <option>22</option>
        <option>23</option>
        <option>24</option>
        <option>25</option>

        <option>26</option>
        <option>27</option>
        <option>28</option>
        <option>29</option>
        <option>30</option>
        <option>31</option>

     
      </select>&nbsp; <select size="1" name="year">
        <option selected="">2011</option>

          <option>2012</option>
        <option>2013</option>
        <option>2014</option>
      </select></font></b></p>

    <p align="left"><b><font face="Comic Sans MS" size="4" color="#003366">Payment method preffered for deposit?<select size="1" name="Deposit_Payment_Method">
      <option>Credit Card</option>
      <option selected>Money Order</option>
      </select></font></b></p>
      
    <p><strong><font color="#003366" size="4" face="Comic Sans MS">How can I get in touch with you?</font></strong></p>
      
      <dl>

        <dd>
          <table height="150">
            <tr>
              <td height="27">
                <p align="left"><b>
                <font size="4" face="Comic Sans MS" color="#003366">Name </font></b>
              <td height="27">
                <p align="left">

                <font face="Comic Sans MS" size="4"><b><font color="#003366">
                <input type="text" size="35" maxlength="256" name="name">
                </font></b><font color="#FF0000">required</font><b><font color="#003366">
                </font></b></font>
            </tr>
            <tr>
              <td height="27">
                <p align="left"><b>

                <font size="4" face="Comic Sans MS" color="#003366">E-mail </font>
                </b>
              <td height="27">
                <p align="left"><font face="Comic Sans MS" size="4"><b>
                <font color="#003366">
                <input type="text" size="35" maxlength="256" name="email">
                </font></b></font>
            </tr>

            <tr>
              <td height="27">
                <p align="left"><b>
                <font size="4" face="Comic Sans MS" color="#003366">Home </font></b>
              <td height="27">
                <p align="left">
                <font face="Comic Sans MS" size="4"><b><font color="#003366">
                <input type="text" size="35" maxlength="256" name="phone">

                </font></b><font color="#FF0000">required 10 digits </font><font color="#003366">
                &nbsp;</font></font></tr>
            <tr>
              <td height="27">
                <b><font size="4" face="Comic Sans MS" color="#003366">Work</font></b><td height="27">
                <font size="4" face="Comic Sans MS" color="#003366"><b>
                <input type="text" size="35" maxlength="256" name="Work_number"></b></font></tr>
            <tr>
              <td height="27">
                <p align="left"><b>
                <font size="4" face="Comic Sans MS" color="#003366">Cell</font></b><td height="27">
                <p align="left">
                <font face="Comic Sans MS" size="4"><b><font color="#003366">
                <input type="text" size="35" maxlength="256" name="User_cell ">
                </font></b></font>
            </tr>

          </table>
        </dd>
      </dl>
      <p align="left"><font face="Comic Sans MS"><b><font size="4" color="#003366">What is the best time to call?&nbsp;&nbsp;&nbsp;
      </font></b>
          <font color="#003366"><b><font size="4">From</font></b></font></font><font face="Comic Sans MS" size="4"><b><font color="#003366"><select size="1" name="best_time_to_call">
            <option selected>8am</option>

            <option>9am</option>
            <option>10am</option>
            <option>11am</option>
            <option>12am</option>
            <option>1pm</option>
            <option>2pm</option>

            <option>3pm</option>
            <option>4pm</option>
            <option>5pm</option>
            <option>6pm</option>
            <option>7pm</option>
            <option>8pm</option>

            <option>9pm</option>
            <option>10pm</option>
          </select> </font></b></font><font face="Comic Sans MS"> <b>
      <font size="4" color="#003366">To </font></b></font>
      <font face="Comic Sans MS" size="4"><b><font color="#003366"><select size="1" name="until">
            <option>8am</option>

            <option>9am</option>
            <option>10am</option>
            <option>11am</option>
            <option>12am</option>
            <option>1pm</option>
            <option>2pm</option>

            <option>3pm</option>
            <option>4pm</option>
            <option>5pm</option>
            <option>6pm</option>
            <option>7pm</option>
            <option>8pm</option>

            <option>9pm</option>
            <option selected>10pm</option>
          </select>&nbsp; </font></b></font>
      <p align="left"><b><font face="Comic Sans MS" size="4" color="#003366">How 
      would you prefer to be contacted?
      <select size="1" name="Prefer_to_be_contacted_by">
      <option selected>Home Phone</option>
      <option>Work Phone</option>

      <option>Cell Phone</option>
      <option>E-mail</option>
      </select></font></b><p align="left"><b>
      <font color="#003366" face="Comic Sans MS" size="4">What time zone are you in <select size="1" name="Time_zone">
            <option selected>Eastern</option>
            <option>Central</option>

            <option>Mountain</option>
            <option>Pacific</option>
            <option>Out of USA</option>
          </select></font></b><p align="left"><font color="#FF0000" size="4"><b>Questions or comments about your trip</b></font></p>
      <p align="left"><textarea rows="5" name="Comments" cols="67"></textarea></p>
      <p align="left">&nbsp;</p>

      <p align="left">
      <b>
      <font color="#003366" size="4" face="Comic Sans MS">We will contact you as soon as possible to finish Booking your fishing trip.</font></b></p>
      <p>
      <input type="submit" value="Submit"> 
      <input type="reset" value="Clear Form"></p>
    </form>

  • #2
    Regular Coder djh101's Avatar
    Join Date
    May 2009
    Location
    California
    Posts
    614
    Thanks
    48
    Thanked 64 Times in 64 Posts
    "Yeah science!"
    Online Science Tools


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •