Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Problems with PHP form

  1. #1

    Problems with PHP form

    Hi!
    I am develping a web form using PHP code, but I am having some difficulties. I have used the tutorial at http://www.kirupa.com/web/php_contact_form.htm that I have found very helpful, but I can not seem to get the form to email properly. Can someone offer me some help please?

    This is the code i used for the html form:

    HTML Code:
    <form name="reservaciones" enctype="text/plain" method="POST" action="reservations_eng.php"> 
    <table width="500" height="500" border="1" bgcolor="#E0CFB8">
      <tr>
        <td valign="top" bgcolor="#FFF0BF"><table width="452" border="0" align="center" cellpadding="0" cellspacing="0">
    
          <tr>
            <td height="40" colspan="3" class="style1"><img src="images/servicios_08.gif" width="254" height="45" /></td>
            </tr>
          <tr>
            <td height="26" colspan="3" class="style1">Personal Information:</td>
            </tr>
          <tr>
            <td width="127" height="26" class="Estilo18">Name(s) and Surname(s):</td>
            <td width="9" height="26">&nbsp;</td>
            <td width="316" height="26" class="boton"><input name="names" type="text" class="levine" id="names" size="35" /></td>
          </tr>
    
          <tr>
            <td height="26" class="Estilo18">E-mail:</td>
            <td width="9" height="26">&nbsp;</td>
            <td height="26" class="boton"><input name="email" type="text" class="levine" id="email" size="35" /></td>
          </tr>
          <tr>
            <td width="127" height="26" class="Estilo18">Country:</td>
            <td width="9" height="26">&nbsp;</td>
    
            <td height="26" class="boton"><font color="#333300" face="Verdana" size="2">
              <select name="country" size="1" class="levine" id="country">
                <option selected="selected">- - Select your country - -</option>
                <option value="Afghanistan">Afghanistan </option>
                <option value="Albania">Albania </option>
                <option value="Algeria">Algeria </option>
                <option value="American Samoa">American Samoa </option>
                <option value="Andorra">Andorra </option>
    
                <option value="Angola">Angola </option>
                <option value="Anguilla">Anguilla </option>
                <option value="Antarctica">Antarctica </option>
                <option value="Antigua y Barbuda">Antigua y Barbuda </option>
                <option value="Argentina">Argentina </option>
                <option value="Armenia">Armenia </option>
    
                <option value="Aruba">Aruba </option>
                <option value="Australia">Australia </option>
                <option value="Austria">Austria </option>
                <option value="Azerbaijan">Azerbaijan </option>
                <option value="Bahamas">Bahamas </option>
                <option value="Bahrain">Bahrain </option>
    
                <option value="Bangladesh">Bangladesh </option>
                <option value="Barbados">Barbados </option>
                <option value="Belarus">Belarus </option>
                <option value="Belgium">Belgium </option>
                <option value="Belize">Belize </option>
                <option value="Benin">Benin </option>
    
                <option value="Bermuda">Bermuda </option>
                <option value="Bhutan">Bhutan </option>
                <option value="Bolivia">Bolivia </option>
                <option value="Bosnia y Herzegowina">Bosnia y Herzegowina </option>
                <option value="Botswana">Botswana </option>
                <option value="Bouvet Island">Bouvet Island </option>
    
                <option value="Brasil">Brasil </option>
                <option value="British Indian Ocean Territory">British Indian Ocean Territory </option>
                <option value="Brunei Darussalam">Brunei Darussalam </option>
                <option value="Bulgaria">Bulgaria </option>
                <option value="Burkina Faso">Burkina Faso </option>
                <option value="Burundi">Burundi </option>
    
                <option value="Cambodia">Cambodia </option>
                <option value="Cameroon">Cameroon </option>
                <option value="Canada">Canada </option>
                <option value="Cape Verde">Cape Verde </option>
                <option value="Islas Cayman">Islas Cayman </option>
                <option value="Central African Republic">Central African Republic </option>
    
                <option value="Chad">Chad </option>
                <option value="Chile">Chile </option>
                <option value="China">China </option>
                <option value="Christmas Island">Christmas Island </option>
                <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands </option>
                <option value="Colombia">Colombia </option>
    
                <option value="Comoros">Comoros </option>
                <option value="Congo">Congo </option>
                <option value="Cook Islands">Cook Islands </option>
                <option value="Costa Rica">Costa Rica </option>
                <option value="Cote D'Ivoire">Cote D'Ivoire </option>
                <option value="Croatia">Croatia </option>
    
                <option value="Cuba">Cuba </option>
                <option value="Cyprus">Cyprus </option>
                <option value="Czech Republic">Czech Republic </option>
                <option value="Denmark">Denmark </option>
                <option value="Djibouti">Djibouti </option>
                <option value="Dominica">Dominica </option>
    
                <option value="Dominican Republic">Dominican Republic </option>
                <option value="East Timor">East Timor </option>
                <option value="Ecuador">Ecuador </option>
                <option value="Egipto">Egipto </option>
                <option value="El Salvador">El Salvador </option>
                <option value="Equatorial Guinea">Equatorial Guinea </option>
    
                <option value="Eritrea">Eritrea </option>
                <option value="Estonia">Estonia </option>
                <option value="Espa&ntilde;a">Espa&ntilde;a</option>
                <option value="Ethiopia">Ethiopia </option>
                <option value="Falkland Islands">Falkland Islands </option>
                <option value="Faroe Islands">Faroe Islands </option>
    
                <option value="Fiji">Fiji </option>
                <option value="Finland">Finland </option>
                <option value="Francia">Francia </option>
                <option value="Francia, Metropolitan">Francia, Metropolitan </option>
                <option value="French Guiana">French Guiana </option>
                <option value="French Polynesia">French Polynesia </option>
    
                <option value="French Southern Territories">French Southern Territories </option>
                <option value="Gabon">Gabon </option>
                <option value="Gambia">Gambia </option>
                <option value="Georgia">Georgia </option>
                <option value="Germany">Germany </option>
                <option value="Ghana">Ghana </option>
    
                <option value="Gibraltar">Gibraltar </option>
                <option value="Grecia">Grecia </option>
                <option value="Greenland">Greenland </option>
                <option value="Granada">Granada </option>
                <option value="Guadeloupe">Guadeloupe </option>
                <option value="Guam">Guam </option>
    
                <option value="Guatemala">Guatemala </option>
                <option value="Guinea">Guinea </option>
                <option value="Guinea-Bissau">Guinea-Bissau </option>
                <option value="Guyana">Guyana </option>
                <option value="Haiti">Haiti </option>
                <option value="Heard and Mc Donald Islands">Heard and Mc Donald Islands </option>
    
                <option value="Honduras">Honduras </option>
                <option value="Hong Kong">Hong Kong </option>
                <option value="Hungary">Hungary </option>
                <option value="Iceland">Iceland </option>
                <option value="India">India </option>
                <option value="Indonesia">Indonesia </option>
    
                <option value="Iran">Iran </option>
                <option value="Iraq">Iraq </option>
                <option value="Ireland">Ireland </option>
                <option value="Israel">Israel </option>
                <option value="Italia">Italia </option>
                <option value="Jamaica">Jamaica </option>
    
                <option value="Jap&oacute;n">Jap&oacute;n </option>
                <option value="Jordan">Jordan </option>
                <option value="Kazakhstan">Kazakhstan </option>
                <option value="Kenya">Kenya </option>
                <option value="Kiribati">Kiribati </option>
                <option value="Korea, Democratic People's Republic of">Korea, Democratic People's Republic of </option>
    
                <option value="Korea, Republic of">Korea, Republic of </option>
                <option value="Kuwait">Kuwait </option>
                <option value="Kyrgyzstan">Kyrgyzstan </option>
                <option value="Lao People's Democratic Republic">Lao People's Democratic Republic </option>
                <option value="Latvia">Latvia </option>
                <option value="Lebanon">Lebanon </option>
    
                <option value="Lesotho">Lesotho </option>
                <option value="Liberia">Liberia </option>
                <option value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya </option>
                <option value="Liechtenstein">Liechtenstein </option>
                <option value="Lithuania">Lithuania </option>
                <option value="Luxembourg">Luxembourg </option>
    
                <option value="Macau">Macau </option>
                <option value="Macedonia, The Former Yugoslav Republic of,">Macedonia, The Former Yugoslav Republic of, </option>
                <option value="Madagascar">Madagascar </option>
                <option value="Malawi">Malawi </option>
                <option value="Malaysia">Malaysia </option>
                <option value="Maldives">Maldives </option>
    
                <option value="Mali">Mali </option>
                <option value="Malta">Malta </option>
                <option value="Marshall Islands">Marshall Islands </option>
                <option value="Martinique">Martinique </option>
                <option value="Mauritania">Mauritania </option>
                <option value="Mauritius">Mauritius </option>
    
                <option value="Mayotte">Mayotte </option>
                <option value="Mexico">Mexico </option>
                <option value="Micronesia, Federated States of,">Micronesia, Federated States of, </option>
                <option value="Moldova, Republic of,">Moldova, Republic of, </option>
                <option value="Monaco">Monaco </option>
                <option value="Mongolia">Mongolia </option>
    
                <option value="Montserrat">Montserrat </option>
                <option value="Morocco">Morocco </option>
                <option value="Mozambique">Mozambique </option>
                <option value="Myanmar">Myanmar </option>
                <option value="Namibia">Namibia </option>
                <option value="Nauru">Nauru </option>
    
                <option value="Nepal">Nepal </option>
                <option value="Netherlands">Netherlands </option>
                <option value="Netherlands Antilles">Netherlands Antilles </option>
                <option value="New Caledonia">New Caledonia </option>
                <option value="New Zealand">New Zealand </option>
                <option value="Nicaragua">Nicaragua </option>
    
                <option value="Niger">Niger </option>
                <option value="Nigeria">Nigeria </option>
                <option value="Niue">Niue </option>
                <option value="Norfolk Island">Norfolk Island </option>
                <option value="Northern Mariana Islands">Northern Mariana Islands </option>
                <option value="Norway">Norway </option>
    
                <option value="Oman">Oman </option>
                <option value="Pakistan">Pakistan </option>
                <option value="Palau">Palau </option>
                <option value="Panama">Panama </option>
                <option value="Papua New Guinea">Papua New Guinea </option>
                <option value="Paraguay">Paraguay </option>
    
                <option value="Per&uacute;">Per&uacute; </option>
                <option value="Philippines">Philippines </option>
                <option value="Pitcairn">Pitcairn </option>
                <option value="Poland">Poland </option>
                <option value="Portugal">Portugal </option>
                <option value="Puerto Rico">Puerto Rico </option>
    
                <option value="Qatar">Qatar </option>
                <option value="Reunion">Reunion </option>
                <option value="Romania">Romania </option>
                <option value="Russian Federation">Russian Federation </option>
                <option value="Rwanda">Rwanda </option>
                <option value="Saint Helena">Saint Helena </option>
    
                <option value="Saint Kitts and Nevis">Saint Kitts and Nevis </option>
                <option value="Saint Lucia">Saint Lucia </option>
                <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon </option>
                <option value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines </option>
                <option value="Samoa">Samoa </option>
                <option value="San Marino">San Marino </option>
    
                <option value="Sao Tome and Principe">Sao Tome and Principe </option>
                <option value="Saudi Arabia">Saudi Arabia </option>
                <option value="Senegal">Senegal </option>
                <option value="Seychelles">Seychelles </option>
                <option value="Sierra Leone">Sierra Leone </option>
                <option value="Singapore">Singapore </option>
    
                <option value="Slovakia (Slovak Republic)">Slovakia (Slovak Republic) </option>
                <option value="Slovenia">Slovenia </option>
                <option value="Solomon Islands">Solomon Islands </option>
                <option value="Somalia">Somalia </option>
                <option value="South Africa">South Africa </option>
                <option value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands </option>
    
                <option value="Sri Lanka">Sri Lanka </option>
                <option value="Sudan">Sudan </option>
                <option value="Suriname">Suriname </option>
                <option value="Svalbard and Jan Mayen Islands">Svalbard and Jan Mayen Islands </option>
                <option value="Swaziland">Swaziland </option>
                <option value="Sweden">Sweden </option>
    
                <option value="Switzerland">Switzerland </option>
                <option value="Syrian Arab Republic">Syrian Arab Republic </option>
                <option value="Taiwan">Taiwan </option>
                <option value="Tajikistan">Tajikistan </option>
                <option value="Tanzania, United Republic of,">Tanzania, United Republic of, </option>
                <option value="Thailand">Thailand </option>
    
                <option value="Togo">Togo </option>
                <option value="Tokelau">Tokelau </option>
                <option value="Tonga">Tonga </option>
                <option value="Trinidad and Tobago">Trinidad and Tobago </option>
                <option value="Tunisia">Tunisia </option>
                <option value="Turkey">Turkey </option>
    
                <option value="Turkmenistan">Turkmenistan </option>
                <option value="Turks and Caicos Islands">Turks and Caicos Islands </option>
                <option value="Tuvalu">Tuvalu </option>
                <option value="Uganda">Uganda </option>
                <option value="Ukraine">Ukraine </option>
                <option value="United Arab Emirates">United Arab Emirates </option>
    
                <option value="United Kingdom">United Kingdom </option>
                <option value="United States">United States</option>
                <option value="United States Minor Outlying Islands">United States Minor Outlying Islands </option>
                <option value="Uruguay">Uruguay </option>
                <option value="Uzbekistan">Uzbekistan </option>
                <option value="Vanuatu">Vanuatu </option>
    
                <option value="Vatican City State (Holy See)">Vatican City State (Holy See) </option>
                <option value="Venezuela">Venezuela </option>
                <option value="Viet Nam, Socialist Republic of">Viet Nam, Socialist Republic of </option>
                <option value="Virgin Islands (British)">Virgin Islands (British) </option>
                <option value="Virgin Islands (U.S.)">Virgin Islands (U.S.) </option>
                <option value="Wallis and Futuna Islands">Wallis and Futuna Islands </option>
    
                <option value="Western Sahara">Western Sahara </option>
                <option value="Yemen">Yemen </option>
                <option value="Yugoslavia">Yugoslavia </option>
                <option value="Zaire">Zaire </option>
                <option value="Zambia">Zambia </option>
                <option value="Zimbabwe">Zimbabwe </option>
              </select>
            </font></td>
          </tr>
          <tr>
            <td width="127" height="26" class="Estilo18">Telephone:</td>
            <td width="9" height="26">&nbsp;</td>
            <td height="26" class="boton"><input name="phone" type="text" class="levine" id="phone" size="10" /></td>
          </tr>
          <tr>
            <td height="26" class="Estilo18"># of people:</td>
            <td height="26">&nbsp;</td>
            <td height="26" class="boton"><input name="people" type="text" class="levine" id="people" size="10" /></td>
          </tr>
          <tr>
            <td height="26" colspan="3" class="Estilo18"><span class="style1">Arrival Date:</span></td>
            </tr>
    
          <tr>
            <td height="26" class="Estilo18">Arrival time:</td>
            <td height="26">&nbsp;</td>
            <td height="26" class="boton"><input name="hour_arrival" type="text" class="levine" id="hour_arrival" value="00:00" size="8" />
                <font color="#333300" face="Verdana" size="2">
                <select name="am_fm" size="1" class="levine" id="am_fm">
                  <option value="AM">AM</option>
                  <option value="PM">PM</option>
                </select>
              </font> </td>
          </tr>
          <tr>
            <td height="26" class="Estilo18">Check in date:</td>
            <td height="26">&nbsp;</td>
            <td height="26" class="boton"><font color="#333300" face="Verdana" size="2">
              <select name="checkin_date" size="1" class="levine" id="checkin_date">
    
                <option value="January" selected="selected">January</option>
                <option value="February">February</option>
                <option value="March">March</option>
                <option value="April">April</option>
                <option value="May">May</option>
                <option value="June">June</option>
    
                <option value="July">July</option>
                <option value="August">August</option>
                <option value="September">September</option>
                <option value="October">October</option>
                <option value="November">November</option>
                <option value="December">December</option>
              </select>
              <select name="checkin_day" size="1" class="levine" id="checkin_day">
                <option value="1" selected="selected">1 </option>
                <option value="2">2 </option>
                <option value="3">3 </option>
                <option value="4">4 </option>
                <option value="5">5 </option>
    
                <option value="6">6 </option>
                <option value="7">7 </option>
                <option value="8">8 </option>
                <option value="9">9 </option>
                <option value="10">10 </option>
                <option value="11">11 </option>
    
                <option value="12">12 </option>
                <option value="13">13 </option>
                <option value="14">14 </option>
                <option value="15">15 </option>
                <option value="16">16 </option>
                <option value="17">17 </option>
    
                <option value="18">18 </option>
                <option value="19">19 </option>
                <option value="20">20 </option>
                <option value="21">21 </option>
                <option value="22">22 </option>
                <option value="23">23 </option>
    
                <option value="24">24 </option>
                <option value="25">25 </option>
                <option value="26">26 </option>
                <option value="27">27 </option>
                <option value="28">28 </option>
                <option value="29">29 </option>
    
                <option value="30">30 </option>
                <option value="31">31 </option>
              </select>
            </font></td>
          </tr>
          <tr>
            <td width="127" height="26" class="Estilo18">Pick up airport:</td>
    
            <td width="9" height="26">&nbsp;</td>
            <td height="26" class="boton"><font color="#333300" face="Verdana" size="2">
              <select name="pick_airport" size="1" class="levine" id="pick_airport">
                <option value="Yes">Yes</option>
                <option value="No" selected="selected">No</option>
                        </select>
            </font></td>
          </tr>
          <tr>
            <td height="26" colspan="3" class="Estilo2"><span class="style1">Departure Date:</span></td>
            </tr>
          <tr>
            <td height="26" class="Estilo18"> Departure time:</td>
            <td height="26">&nbsp;</td>
            <td height="26" class="boton"><input name="hour_departure" type="text" class="levine" id="hour_departure" value="00:00" size="8" />
                <font color="#333300" face="Verdana" size="2">
                <select name="am_fm2" size="1" class="levine" id="am_fm2">
                  <option value="AM">AM</option>
                  <option value="PM">PM</option>
                </select>
              </font> </td>
          </tr>
          <tr>
            <td height="26" class="Estilo18">Check out date:&nbsp;</td>
            <td height="26">&nbsp;</td>
            <td height="26" class="boton"><font color="#333300" face="Verdana" size="2">
              <select name="checkout_month" size="1" class="levine" id="checkout_month">
                <option value="January" selected="selected">January</option>
                <option value="February">February</option>
                <option value="March">March</option>
                <option value="April">April</option>
                <option value="May">May</option>
                <option value="June">June</option>
                <option value="July">July</option>
                <option value="August">August</option>
                <option value="September">September</option>
                <option value="October">October</option>
                <option value="November">November</option>
                <option value="December">December</option>
              </select>
              <select name="checkout_day" size="1" class="levine" id="checkout_day">
                <option value="1" selected="selected">1 </option>
                <option value="2">2 </option>
                <option value="3">3 </option>
                <option value="4">4 </option>
                <option value="5">5 </option>
                <option value="6">6 </option>
                <option value="7">7 </option>
                <option value="8">8 </option>
                <option value="9">9 </option>
                <option value="10">10 </option>
                <option value="11">11 </option>
                <option value="12">12 </option>
                <option value="13">13 </option>
                <option value="14">14 </option>
                <option value="15">15 </option>
                <option value="16">16 </option>
                <option value="17">17 </option>
                <option value="18">18 </option>
                <option value="19">19 </option>
                <option value="20">20 </option>
                <option value="21">21 </option>
                <option value="22">22 </option>
                <option value="23">23 </option>
                <option value="24">24 </option>
                <option value="25">25 </option>
                <option value="26">26 </option>
                <option value="27">27 </option>
                <option value="28">28 </option>
                <option value="29">29 </option>
                <option value="30">30 </option>
                <option value="31">31 </option>
              </select>
            </font></td>
          </tr>
          <tr>
            <td height="26" class="Estilo18">Airline &amp; Flight #:  </td>
            <td height="26">&nbsp;</td>
            <td height="26"><span class="boton">
              <input name="airline" type="text" class="levine" id="airline" size="30" />
            </span><span class="Estilo2">- <span class="boton">
            <input name="flight" type="text" class="levine" id="flight" size="6" />
    
            </span></span></td>
          </tr>
          <tr>
            <td height="26" colspan="3" class="Estilo2">&nbsp;</td>
            </tr>
          <tr>
            <td height="26" valign="top" class="Estilo18">Special Request:</td>
            <td width="9" height="26">&nbsp;</td>
            <td height="26"><textarea name="comment" cols="40" rows="3" class="levine" id="comment"></textarea></td>
          </tr>
          
          <tr>
            <td height="26">&nbsp;</td>
            <td width="9" height="26">&nbsp;</td>
            <td height="26" class="boton"><input name="reset" type="reset" class="boton" value="Clear" />
                <input name="submit" type="submit" class="boton" value="Send" /></td>
          </tr>
        </table></td>
    
      </tr>
    </table>
    </form>
    This is the code in [PHP] i used for the mailer:

    PHP Code:
    <?php
    if(isset($_POST['submit'])) {

        
    $to "manu@manuartwork.com"
        
    $subject "Reservations Lima Travel Lodge";
        
    $names_field $_POST['names'];
        
    $email_field $_POST['email'];
        
    $country $_POST['country'];
        
    $phone $_POST['phone'];
        
    $number of people $_POST['number of people'];
        
    $hour_arrival $_POST['hour_arrival'];
        
    $am_fm $_POST['am_fm'];
        
    $checkin_date $_POST['checkin_date'];
        
    $checkin_day $_POST['checkin_day'];
        
    $pick_airport $_POST['pick_airport'];
        
    $hour_departure $_POST['hour_departure'];
        
    $am_fm2 $_POST['am_fm2'];
        
    $checkout_month $_POST['checkout_month'];
        
    $checkout_month $_POST['checkout_day'];
        
    $airline $_POST['airline'];
        
    $flight $_POST['flight'];
        
    $comment $_POST['comment'];

        
        
    $body "From: $name_field\n  E-Mail: $email_field\n Country: $country\n Phone: $phone\n  People: $people\n  Hour_arrival: $hour_arrival\n Am_fm: $am_fm\n Checkin_date: $checkin_date\n  Checkin_day: $checkin_day\n  Pick_airport: $pick_airport\n  Hour_departure: $hour_departure\n Am_fm2: $am_fm2\n  Checkout_month: $checkout_month\n  Checkout_day: $checkout_day\n  Airline: $airline\n  Flight: $flight\n  Comment:\n $comment\n";

        echo 
    "THANKS! Your message has been submitted to $to.<br>
        I will respond to your message shortly"
    ;
        
    mail($to$subject$body);
        
    } else {
        echo 
    "An error has occurred, your message has not been sent, please try again, sorry for the inconvenience";
    }
    ?>
    Last edited by Manu Arts; February 6th, 2008 at 10:49 AM.

  2. #2
    Whats happening with it?

  3. #3
    Please use the appropriate BBCode tags with your posts ([php], [code], [html], etc.)
    got pwnt?

  4. #4
    Quote Originally Posted by cubed View Post
    Whats happening with it?
    Ok. When i fill the data in the form, the page does not send the information, and the "mailer.php" (who process the information) doesnt show the "Thanks for your message" after you send the form, there is something wrong with the [php] file i think... Hope you can help me
    Thanks

  5. #5
    Edit your original post and put the PHP code brackets on it so I can read through it 8)

  6. #6
    Quote Originally Posted by Syous View Post
    Edit your original post and put the PHP code brackets on it so I can read through it 8)
    Ok, i did it , i dont know a lot about php programation hope you can help me!
    Thanks!!!

  7. #7
    put [ php ] at the font, with no spaces and put [ /php ] at the end, again with no spaces

  8. #8
    Quote Originally Posted by Syous View Post
    put [ php ] at the font, with no spaces and put [ /php ] at the end, again with no spaces
    Ok, i did it!
    Thanks

  9. #9
    this might be a little obvious but does your php file open with <? and close with ?>

  10. #10
    Quote Originally Posted by Syous View Post
    this might be a little obvious but does your php file open with <? and close with ?>
    Yes, it does

  11. #11
    Hrmm, I'm not really seeing anything wrong then.

  12. #12
    don't know if this is the problem but it is an error:

    Code:
    <input name="number of people" type="text" class="levine" id="number of people" size="10" />
    no spaces allowed in id's and names...

    also an error in your mail.php

    should cause a php error:
    Code:
    $number of people = $_POST['number of people'];
    no spaces allowed here...

  13. #13
    Quote Originally Posted by borrob View Post
    don't know if this is the problem but it is an error:

    Code:
    <input name="number of people" type="text" class="levine" id="number of people" size="10" />
    no spaces allowed in id's and names...

    also an error in your mail.php

    should cause a php error:
    Code:
    $number of people = $_POST['number of people'];
    no spaces allowed here...
    Thanks a lot for your help, yes it was a mistake, i fixed a part of the problem, but still the form does not sent the information, but now i can see the second echo for error, so it means there is something wrong with the php mailer right?
    Code:
    } else {
        echo "An error has occurred, your message has not been sent, please try again, sorry for the inconvenience";
    }

  14. #14
    Code:
    <?php
    if(isset($_POST['submit'])) {
    
        echo "THANKS! Your message has been submitted to $to.<br>
        I will respond to your message shortly";
        mail($to, $subject, $body);
        
    } else {
        echo "An error has occurred, your message has not been sent, please try again, sorry for the inconvenience";
    }
    ?>
    The else statement will fire if it does not receive a submit

    Code:
    if(isset($_POST['submit'])) {
       /*YOUR CODE */
        if (mail($sendTo, $subject, $body, $headers)){
                echo "Message Sent! Thank you we will be reading your message shortly.";
    // BELOW WILL FIRE IF MESSAGE IS NOT SENT 
             } else {
                 echo "Sorry your Message could not be Sent.";
             }
    /// END IF SUBMIT BELOW WILL FIRE IF PAGE IS LOADED WITH NO SUBMIT
    } else {
        echo "An error has occurred, your message has not been sent, please try again, sorry for the inconvenience";
    }
    http://us.php.net/manual/en/function.mail.php
    Web Site Design and Stuff....One day I will get it.

  15. #15
    OK, I fixed! thanks everybody for your help!!
    You are the best!

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012