SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need form to display current date

    I have just added a form for visitors to use making a reservation at this site:
    http://yankeeinn.com
    I want to set the arrival date to the current date, and the departure date to the day after. How do I do that?

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>
    <div>
    <div>
    <div align="center">
     
    <form action="https://secure.iqres02075.com/iqreservations/asp/Home.asp?VIEWAS=*" method="GET" name="0.2_Res_Form" target="_blank" onsubmit="return window.confirm(&quot;You are submitting information to an external page.\nAre you sure?&quot;);">
     
    <table cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td><span>
    Arrival Date:
    </span></td>
    </tr><tr><td>
    <table cellpadding="0" cellspacing="0">
    <tbody><tr><td><select name="CIM" size="1">   
    <option value="01" selected>January</option>
    <option value="02">February</option>
    <option value="03">March</option>
    <option value="04">April</option>
    <option value="05">May</option>
    <option value="06">June</option>
    <option value="07">July</option>
    <option value="08">August</option>
    <option value="09">September</option>
    <option value="10">October</option>
    <option value="11">November</option>
    <option value="12">December</option>
    
    </select></td>
    
    <td><select name="CID" size="1">   
    <option value="01" selected>01</option>
    <option value="02">02</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></td>
    
    <td><select name="CIY" size="1">   
    <option value="2012" selected>2012</option>
    <option value="2013">2013</option>
    <option value="2014">2014</option>
    </select></td>
    
    </tr> 
    </tbody>
    
    <tr>
    <td colspan="3">
    <table width="100%">
    <td><br>
    <tbody>
    <tr>
    
    <td><span>
    Departure Date:
    </span></td>
    </tr><tr><td>
    <table cellpadding="0" cellspacing="0">
    <tbody><tr><td><select name="COM" size="1">   
    <option value="01" selected>January</option>
    <option value="02">February</option>
    <option value="03">March</option>
    <option value="04">April</option>
    <option value="05">May</option>
    <option value="06">June</option>
    <option value="07">July</option>
    <option value="08">August</option>
    <option value="09">September</option>
    <option value="10">October</option>
    <option value="11">November</option>
    <option value="12">December</option>
    
    </select></td>
    
    <td><select name="COD" size="1">   
    <option value="01" selected>01</option>
    <option value="02">02</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></td>
    
    <td><select name="COY" size="1">   
    <option value="2012" selected>2012</option>
    <option value="2013">2013</option>
    <option value="2014">2014</option>
    </select></td>
    
    </tr> 
    </tbody>
    
    <tr>
    <td colspan="3">
    <table width="100%">
    <td><br>
    <tbody>
    <tr>
    
    <td width="33%"><span>
    Adults:
    </span><br>
    <select name="AD">   
    <option value="1">1</option>
    <option value="2" selected>2</option>
    <option value="3">03</option>
    <option value="4">04</option>
    <option value="5">05</option>                        
    </select></td>
    
    
    
    <td width="33%"><span>
    Children:
    </span><br>
    <select name="CH">   
    <option value="0" selected>0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    </select></td>
    
    
    
    <td width="34%"><span>
    Rooms:
    </span><br>
    <select name="RMS">   
    <option value="1" selected>1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    <option value="5">5</option>
    </select></td>
    </tr>
    <tr>
    <td><span>
    Promo Code:  
    </span>
    <br>
    <input size="10" name="PC" maxlength="10" value="" type="text">     
    </td>
    </tr>
    <tr>
    <td colspan="3"> <center> * All discount rates verified at check-in. 
    <br> 
    <br> 
    <input type="submit" name="action" value="Check Availability">
    <br> </center>
    </td> </tr> </tbody> </td></table> </td> </tr>
    </table></td></tr></tbody> </td></table> </td></tr></table> </td></tr></tbody></table> 
    </form>
    </div> </div>
    </div>
    </body></html>
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  2. #2
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,350
    Mentioned
    214 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by paulcj2 View Post
    I want to set the arrival date to the current date, and the departure date to the day after. How do I do that?
    Just out of interest, why? If I'm making a hotel reservation on-line, it's not going to be for the same day I make it. I'd guess few, if any, of your guests will be trying to book for that current date and find that helpful.

    To answer your question, I suspect it can't be done with HTML and will require PHP.
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  3. #3
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Setting the booking engine with these dates is common practice. For example: https://secure.rezovation.com/Reserv...x?s=9lK7r0lzmc
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  4. #4
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,350
    Mentioned
    214 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by paulcj2 View Post
    Setting the booking engine with these dates is common practice. For example: https://secure.rezovation.com/Reserv...x?s=9lK7r0lzmc
    Yes, I know - but it still makes no sense to me.
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  5. #5
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need form to display current date

    I have just added an HTML form for visitors to use making a reservation at this site:
    http://yankeeinn.com

    I want to set the arrival date to the current date, and the departure date to the day after. I understand this cannot be done in HTML, and the site host says they do not support PHP, or any server side scripting.

    They do support JavaScript accessing something from a remote server. Does this make sense? If so, what would the set-up and code look like?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  6. #6
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,350
    Mentioned
    214 Post(s)
    Tagged
    5 Thread(s)
    Threads merged to avoid duplicating replies.
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  7. #7
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wanted this posted on the PHP/JavaScript forum. Will it be seen there also? Or does it need to be moved there?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,601
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Quote Originally Posted by paulcj2 View Post
    I wanted this posted on the PHP/JavaScript forum. Will it be seen there also? Or does it need to be moved there?
    It's in the JS forum now, but can't be in both places at once. Looking at it now, I'd say you are better off doing this with PHP. If your host doesn't support PHP, my strong advice is to get another host ASAP. That is simply not good enough for a web host. Even the cheapest, nastiest hosts out there give you PHP.

  9. #9
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you move this from the JavaScript to the PHP forum?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  10. #10
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,601
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    OK, done. But the solutions won't be much use to you unless you sort out your hosting situation.

  11. #11
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it handled. Thanks,
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  12. #12
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm.The thread is still live on the JQ forum. How about we delete the threads everywhere? I will start a new thread on the PHP forum.
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  13. #13
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How can I use PHP to set the current date in a form?

    I have a form in the right sidebar at http://www.yankeeinn.com that visitors use to make a reservation. I want to set the Arrival Date to the current date, and the departure date to the day after the current date. I understand that the existing HTML form cannot be made to do that. But it can be done with PHP. Can anyone help?
    Paul C.
    ClickBasics
    http://www.clickbasics.com

  14. #14
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Use the PHP method getdate() to grab the needed info. Then change the html extension of your form page to a php script. Add your code to the top of the existing content, enclosed in <?php and ?> and then echo the results where needed within the html using <?php echo $varname; ?>. If you need further instructions, refer to the documentation on getdate(). Hope this points you in the right direction.

    http://www.php.net/manual/en/function.getdate.php

  15. #15
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    5,350
    Mentioned
    214 Post(s)
    Tagged
    5 Thread(s)
    Threads merged (again). I have also closed the other thread in the JS forum.
    Off Topic:

    Please don't post multiple threads about the same issue in different areas. If you want a thread moved, just flag the post and ask - easy.
    Don't be arrogant. Be kind to a koala that thinks it's a bear.

  16. #16
    Web Enthusiast
    Join Date
    Jul 2000
    Location
    Western Massachusetts, USA
    Posts
    1,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Got it.
    Paul C.
    ClickBasics
    http://www.clickbasics.com


Bookmarks

Posting Permissions

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