I'm calling a script from my main menu without passing from and to date. The script will use today(from) + 30 days(to) if no date passed. This works fine, here is the code:
<?
$today = Date("Y-m-d"
;
$from = $_REQUEST["fromd"];
$thru = $_REQUEST["thrud"];
if ($from < $today)
{
$from = $today;
}
if ($from >= $thru)
{
$thru = date("Y-m-d",strtotime($from) + (30 * 24 * 60 * 60));
}
?>
On the screen the user can change both from and to dates. They must then click the 'refresh' button which calls the same html and should pass the new dates selected as the parms:
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750" id="AutoNumber4" height="1">
<tr>
<td width="446">
<p align="right"><i><font size="5">Scheduled Service from </font></i>
<INPUT name=from readOnly style="border:1px solid #FFFFFF; TEXT-ALIGN: right; color:#3399FF; font-size:10pt; font-weight:bold" value="<? print $from; ?>" size="8" tabindex="1"><INPUT onclick="fPopCalendar(from,from); return false" type=button id=button1 name=button1 value=" ? " style="font-size: 8pt" ></td>
<td width="207" height="1">
<i><font size="5">thru </font></i>
<INPUT name=thru readOnly style="border:1px solid #FFFFFF; TEXT-ALIGN: left; font-size:10pt; color:#3399FF; font-weight:bold" value="<? print $thru; ?>" size="8" tabindex="2">
<INPUT onclick="fPopCalendar(thru,thru); return false" type=button id=button2 name=button2 value=" ? " style="font-size: 8pt" ></td>
<form method=POST target="_top" action="schedulepage.html?fromd=<? print $from ?>&thrud=<? print $thru ?>">
<td width="97"><INPUT type="submit" value="Refresh" name="B1" style="font-size: 10pt"></td>
</form>
</tr>
</table>
The fPopCalendar works fine. It brings both dates back to the screen in 'from' and thru'. The problem is the submit calls the same script but it doesn't pass the new dates. The url shows:
?fromd=2004-02-15&thrud=2004-03-16
even though I selected 2004-3-31 as the thru date and it showed on the screen but is not being passed as the parameter. Any ideas why?
Thanks to all for their help.
Scott
<?
$today = Date("Y-m-d"
$from = $_REQUEST["fromd"];
$thru = $_REQUEST["thrud"];
if ($from < $today)
{
$from = $today;
}
if ($from >= $thru)
{
$thru = date("Y-m-d",strtotime($from) + (30 * 24 * 60 * 60));
}
?>
On the screen the user can change both from and to dates. They must then click the 'refresh' button which calls the same html and should pass the new dates selected as the parms:
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750" id="AutoNumber4" height="1">
<tr>
<td width="446">
<p align="right"><i><font size="5">Scheduled Service from </font></i>
<INPUT name=from readOnly style="border:1px solid #FFFFFF; TEXT-ALIGN: right; color:#3399FF; font-size:10pt; font-weight:bold" value="<? print $from; ?>" size="8" tabindex="1"><INPUT onclick="fPopCalendar(from,from); return false" type=button id=button1 name=button1 value=" ? " style="font-size: 8pt" ></td>
<td width="207" height="1">
<i><font size="5">thru </font></i>
<INPUT name=thru readOnly style="border:1px solid #FFFFFF; TEXT-ALIGN: left; font-size:10pt; color:#3399FF; font-weight:bold" value="<? print $thru; ?>" size="8" tabindex="2">
<INPUT onclick="fPopCalendar(thru,thru); return false" type=button id=button2 name=button2 value=" ? " style="font-size: 8pt" ></td>
<form method=POST target="_top" action="schedulepage.html?fromd=<? print $from ?>&thrud=<? print $thru ?>">
<td width="97"><INPUT type="submit" value="Refresh" name="B1" style="font-size: 10pt"></td>
</form>
</tr>
</table>
The fPopCalendar works fine. It brings both dates back to the screen in 'from' and thru'. The problem is the submit calls the same script but it doesn't pass the new dates. The url shows:
?fromd=2004-02-15&thrud=2004-03-16
even though I selected 2004-3-31 as the thru date and it showed on the screen but is not being passed as the parameter. Any ideas why?
Thanks to all for their help.
Scott