...

View Full Version : date code PHP-->Js



lse123
06-10-2008, 03:48 PM
Below is code(XHTML) for two date pickers(drop-down menues) well follows a php processor find days between dates inserted ? How I find this in javascript ? Also A visitor how to see current date(GMT+2) in the two drop-down menues groups... remember only gmt+2 but not include time just date ?


<td align="right" valign="middle">
From Date:</td>
<td><font face="Arial, Helvetica, sans-serif" size="2">
<select name="day" size="1" class="formfields" id="day" tabindex="22" ;>
<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>
<select name="month" size="1" class="formfields" id="month" tabindex="23" ;>
<option value="1" selected="selected">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="year" size="1" class="formfields" id="year" tabindex="25" ;>
<option value="2008" selected="selected">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
</select>
</font></td>
</tr>
<tr>
<td align="right" valign="middle">
To Date:</td>
<td><font face="Arial, Helvetica, sans-serif" size="2">
<select name="today" size="1" class="formfields" id="select" tabindex="22" ;>
<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>
<select name="tomonth" size="1" class="formfields" id="select5" tabindex="23" ;>
<option value="1" selected="selected">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<select name="toyear" size="1" class="formfields" id="select3" tabindex="25" ;>
<option value="2008" selected="selected">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
</select>
</font></td>


$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];
$today = $_POST['today'];
$tomonth = $_POST['tomonth'];
$toyear = $_POST['toyear'];

$tsp = mktime(0, 0, 0, $month, $day, $year);
$tsd = mktime(0, 0, 0, $tomonth, $today, $toyear);
$xdays = ($tsd - $tsp)/(24*60*60); // as calculated from dates

Philip M
06-11-2008, 08:02 AM
567 posts, 0 thanks. No response.

lse123
06-11-2008, 09:39 AM
by saying "Thank" what you mean to do ?

Philip M
06-11-2008, 11:04 AM
Are there no words for "please" and "thank you" in your language?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum