
Jan 12th, 2008, 19:58
|
|
SuperMember
|
|
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Re: Monthly Archives using PHP/MySQL?
try adapting this code.
- PHP: Select all
<?php $curr_month = date("m"); $month = array (1=>"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); $select = "<select name=\"month\">\n"; foreach ($month as $key => $val) { $select .= "\t<option val=\"".$key."\""; if ($key == $curr_month) { $select .= " selected>".$val."\n"; } else { $select .= ">".$val."\n"; } } $select .= "</select>"; echo $select; ?>
hope it helps
|