sarah
06-16-2003, 04:49 PM
Hi,
At the moment I use the code below to display the months that users can select:
<select size="1" name="D1">
<?php
writeSingleOption("JAN", "1", $stmonth);
writeSingleOption("FEB", "2", $stmonth);
writeSingleOption("MAR", "3", $stmonth);
writeSingleOption("APR", "4", $stmonth);
writeSingleOption("MAY", "5", $stmonth);
writeSingleOption("JUN", "6", $stmonth);
writeSingleOption("JUL", "7", $stmonth);
writeSingleOption("AUG", "8", $stmonth);
writeSingleOption("SEP", "9", $stmonth);
writeSingleOption("OCT", "10", $stmonth);
writeSingleOption("NOV", "11", $stmonth);
writeSingleOption("DEC", "12", $stmonth);
?>
</select>
I have added the following if statement around the <select>
<?php
if($method=="DD") {
?>
and </select>
<?php
}
?>
If the method is "DD" then the user can only select the current month and next month. I already have done this with the year using the following:
writeSingleOption(date("Y",time()), "", $styear);
writeSingleOption(date("Y",time())+1, "", $styear);
but when itried the following code:
writeSingleOption(date("M",time()), "", $stmonth);
writeSingleOption(date("M",time())+1, "", $stmonth);
this didn't work.
Any ideas how I can achieve this?
Thanks in advance
Sarah
At the moment I use the code below to display the months that users can select:
<select size="1" name="D1">
<?php
writeSingleOption("JAN", "1", $stmonth);
writeSingleOption("FEB", "2", $stmonth);
writeSingleOption("MAR", "3", $stmonth);
writeSingleOption("APR", "4", $stmonth);
writeSingleOption("MAY", "5", $stmonth);
writeSingleOption("JUN", "6", $stmonth);
writeSingleOption("JUL", "7", $stmonth);
writeSingleOption("AUG", "8", $stmonth);
writeSingleOption("SEP", "9", $stmonth);
writeSingleOption("OCT", "10", $stmonth);
writeSingleOption("NOV", "11", $stmonth);
writeSingleOption("DEC", "12", $stmonth);
?>
</select>
I have added the following if statement around the <select>
<?php
if($method=="DD") {
?>
and </select>
<?php
}
?>
If the method is "DD" then the user can only select the current month and next month. I already have done this with the year using the following:
writeSingleOption(date("Y",time()), "", $styear);
writeSingleOption(date("Y",time())+1, "", $styear);
but when itried the following code:
writeSingleOption(date("M",time()), "", $stmonth);
writeSingleOption(date("M",time())+1, "", $stmonth);
this didn't work.
Any ideas how I can achieve this?
Thanks in advance
Sarah