[SOLVED] Populate list/menu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jim_Bo
Forum Contributor
Posts: 390
Joined: Sat Oct 02, 2004 3:04 pm

[SOLVED] Populate list/menu

Post by Jim_Bo »

Hi,

How does one populate a list/menu with 31 days without manually typing in 31 days?

Cheers
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

Not so descriptive... but if you want a pull down menu,

Code: Select all

echo "<select name=\"day\">";
 for ( $x = 1; $x <= 31; $x++ )
  echo "\n\t<option>$x</option>";
 echo "\n</select>";
Jim_Bo
Forum Contributor
Posts: 390
Joined: Sat Oct 02, 2004 3:04 pm

Post by Jim_Bo »

Hi,

Great .. Thanks for that

Cheers
Post Reply