jemthehaitian Posted June 19, 2017 Share Posted June 19, 2017 Hi guys, I'm having a hard time getting my reservation form code to work. Here's what I have in on the page for the code: <form role="form" class="wowload fadeInRight"> <form method="post" action="reservation.php"> <div class="form-group"> <input type="text" name="full_Name" class="form-control" placeholder="Name"> </div> <div class="form-group"> <input type="email" name="email" class="form-control" placeholder="Email"> </div> <div class="form-group"> <input type="Phone" name="phone" class="form-control" placeholder="Phone"> </div> <div class="form-group"> <div class="row"> <div class="col-xs-6"> <select class="form-control"> <select name="rooms"> <option>No. of Rooms</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </div> <div class="col-xs-6"> <select class="form-control"> <select name="adults"> <option>No. of Adults</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </div></div> </div> <p>From:</p> <div class="form-group"> <div class="row"> <div class="col-xs-4"> <select class="form-control col-sm-2" name="from-date" id="from-date"> <option>Date</option> <option value="01">1</option> <option value="02">2</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</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> </div> <div class="col-xs-4"> <select class="form-control col-sm-2" name="from-month" id="from-month"> <option>Month</option> <option value="01">Jan (01)</option> <option value="02">Feb (02)</option> <option value="03">Mar (03)</option> <option value="04">Apr (04)</option> <option value="05">May (05)</option> <option value="06">June (06)</option> <option value="07">July (07)</option> <option value="08">Aug (08)</option> <option value="09">Sep (09)</option> <option value="10">Oct (10)</option> <option value="11">Nov (11)</option> <option value="12">Dec (12)</option> </select> </div> <div class="col-xs-4"> <select class="form-control" name="from-year"> <option value="17">2017</option> <option value="18">2018</option> <option value="19">2019</option> <option value="20">2020</option> <option value="21">2021</option> <option value="22">2022</option> <option value="23">2023</option> </select> </div></div> </div> <p>To:</p> <div class="form-group"> <div class="row"> <div class="col-xs-4"> <select class="form-control col-sm-2" name="to-date" id="to-date"> <option>Date</option> <option value="01">1</option> <option value="02">2</option> <option value="03">03</option> <option value="04">04</option> <option value="05">05</option> <option value="06">06</option> <option value="07">07</option> <option value="08">08</option> <option value="09">09</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> </div> <div class="col-xs-4"> <select class="form-control col-sm-2" name="to-month" id="to-month"> <option>Month</option> <option value="01">Jan (01)</option> <option value="02">Feb (02)</option> <option value="03">Mar (03)</option> <option value="04">Apr (04)</option> <option value="05">May (05)</option> <option value="06">June (06)</option> <option value="07">July (07)</option> <option value="08">Aug (08)</option> <option value="09">Sep (09)</option> <option value="10">Oct (10)</option> <option value="11">Nov (11)</option> <option value="12">Dec (12)</option> </select> </div> <div class="col-xs-4"> <select class="form-control" name="to-year"> <option value="17">2017</option> <option value="18">2018</option> <option value="19">2019</option> <option value="20">2020</option> <option value="21">2021</option> <option value="22">2022</option> <option value="23">2023</option> </select> </div> </div> </div> <div class="form-group"> <textarea class="form-control" name="message" placeholder="Message" rows="4"></textarea> </div> <button class="btn btn-default">Submit</button> </form> </div> </div> </div> </div> Here's the reservation.php script I created: <?php mail( "reservations@cheaphaitianhotel.com", "New Reservation!", "From: ".$_POST['full_name']."/n/n".$_POST['email']."/n/n".$_POST['phone']."/n/n".$_POST['message'], "Rooms: ".$_POST['rooms'], "Number of Guests: ".$_POST['adults'], "Check-In: ".$_POST['from-month']."/n/n".$_POST['from-date']."/n/n".$_POST['from-year'], "Check-Out: ".$_POST['to-month']."/n/n".$_POST['to-date']."/n/n".$_POST['to-year']." <reservations@cheaphaitianhotel.com>"); ?> <?php include 'header.php';?> <!-- reservation-information --> <div id="information" class="spacer reserve-info "> <div class="container"> <div class="row"> <div class="col-sm-7 col-md-8"> <p>Thank you for contacting us. We will be in touch with you very soon.<p/></div> </div> </div> <?php include 'footer.php';?> <?php } die(); ?> Please help Quote Link to comment Share on other sites More sharing options...
Jacques1 Posted June 19, 2017 Share Posted June 19, 2017 Read the forum rules Quote Link to comment Share on other sites More sharing options...
ginerjm Posted June 20, 2017 Share Posted June 20, 2017 Might be a BIG HELP to us if you told us "what didn't work". And if you followed the rules and wrapped your code in the proper tags AND if you learned how to code by completely separating the html from the php so that you didn't have to keep using php tags and so it was more readable overall. So many things..... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.