php date question

by "Michael Gerholdt" <gerholdt(at)fredonia.edu>

 Date:  Sun, 31 Mar 2002 17:58:01 -0500
 To:  "hwg-languages" <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Hi, php users,

This generally works just fine, but when you get to the 31st of a month, my
code for last month returns the same month as my code for this month ...
namely, this month.

There must be something I've got wrong.

The code:


<!-- previous month -->
<? $i = date("M",mktime(0,0,0,date("m")-1,date("d"),date("Y")));?>
<input type="radio" name="month" value="<?=$i?>">&nbsp;<?=$i?>
<BR>
<!-- this month -->
<? $i = date("M",mktime(0,0,0,date("m"),date("d"),date("Y")));?>
<input type="radio" name="month" value="<?=$i?>" checked>&nbsp;<?=$i?>
</td>
<td align="left" valign="top" class="comic">
<!-- next month -->
<? $i = date("M",mktime(0,0,0,date("m")+1,date("d"),date("Y")));?>
<input type="radio" name="month" value="<?=$i?>">&nbsp;<?=$i?>
<BR>
<!-- every month -->
<input type="radio" name="month" value="%">&nbsp;All


Thanks,
Mike

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA