We have a button that runs reports based on a date selects' values. I want to create a similar button next to this one to run the same report but for today only, how do I define the date values for that button based on the existing code?
<tr bgcolor="#efefef" onMouseOver="this.bgColor='#ddddff';" onMouseOut="this.bgColor='#efefef';">
<td width="19%">Start Date</td>
<td width="81%"><select name="sd" style="width:100px;">
<?
$current_day = date('d');
$current_month = date('m');
$current_year = date('Y');
$cur = 1;
while (31 >= $cur) {
echo "<option value=\"".sprintf("%02d", $cur)."\" ".(($cur == $current_day)?'selected':'').">".sprintf("%02d", $cur)."</option>\n";
$cur++;
} ?>
</select> <select name="sm" style="width:150px;">
<? $cur = 1;
while (12 >= $cur) {
echo "<option value=\"".sprintf("%02d", $cur)."\" ".(($cur == ($current_month-1))?'selected':'').">".date("F", strtotime("2006-".sprintf("%02d", $cur)."-01"))."</option>\n";
$cur++;
} ?>
</select>
<select name="sy" style="width:100px;">
<? $cur = 1;
$curyear = date("Y");
while (10 >= $cur) {
echo "<option value=\"$curyear\">$curyear</option>\n";
$curyear--;
$cur++;
} ?>
</select> </td>
</tr>
<tr bgcolor="#efefef" onMouseOver="this.bgColor='#ddddff';" onMouseOut="this.bgColor='#efefef';">
<td>End Date</td>
<td><select name="ed" style="width:100px;">
<? $cur = 1;
while (31 >= $cur) {
echo "<option value=\"".sprintf("%02d", $cur)."\" ".(($cur == $current_day)?'selected':'').">".sprintf("%02d", $cur)."</option>\n";
$cur++;
} ?>
</select> <select name="em" style="width:150px;">
<? $cur = 1;
while (12 >= $cur) {
echo "<option value=\"".sprintf("%02d", $cur)."\" ".(($cur == ($current_month))?'selected':'').">".date("F", strtotime("2006-".sprintf("%02d", $cur)."-01"))."</option>\n";
$cur++;
} ?>
</select>
<select name="ey" style="width:100px;">
<? $cur = 1;
$curyear = date("Y");
while (10 >= $cur) {
echo "<option value=\"$curyear\">$curyear</option>\n";
$curyear--;
$cur++;
} ?>
</select> </td>
</tr>
<tr bgcolor="#efefef" onMouseOver="this.bgColor='#ddddff';" onMouseOut="this.bgColor='#efefef';">
<td> </td>
<td><input type="submit" name="button" id="button" value="Get Report"></td>
</tr>
<tr>
</table></form>
I understand I don't need the Select values here, but is that all I'd need to do?
PHP Noob!