Need form to display current date

I have just added a form for visitors to use making a reservation at this site:

I want to set the arrival date to the current date, and the departure date to the day after. How do I do that?

<!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.\
Are 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>

[FONT=Verdana]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.
[/FONT]

Setting the booking engine with these dates is common practice. For example: https://secure.rezovation.com/Reservations/CheckAvailability.aspx?s=9lK7r0lzmc

[FONT=Verdana]

Yes, I know - but it still makes no sense to me. :slight_smile:
[/FONT]

I have just added an HTML form for visitors to use making a reservation at this site:

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?

Threads merged to avoid duplicating replies.

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.

Can you move this from the JavaScript to the PHP forum?

OK, done. But the solutions won’t be much use to you unless you sort out your hosting situation. :slight_smile:

Got it handled. Thanks,

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.

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?

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

Threads merged (again). I have also closed the other thread in the JS forum. [ot] 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. :)[/ot]

Got it.