I am trying to use PHP to generate and automatically select the current
month in an HTML Form. Here is the code that flails:

  for ($i=01;$i<=12;$i++) {
    if($i = date(m)) {
      $selected = " selected";
    }
    print "<option
value=\"".date(m,mktime(0,0,0,$i))."\"$selected>".date(F,mktime(0,0,0,$i))."
</option>\n";
  }

The output is a large amount of April's in the Select dropdown box - my
machine then goes crazy for a while whilst the hard drive chunks like mad.

Thanks.

-Dash

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to