if ($_POST)
{
echo "You chose ", $_POST;
}
else
{
$families = array ("Peter Griffin","Lois Griffin","Chris Griffin","Meg Griffin","Stewie Griffin") ;
echo '<form name="families" method="post" action="index.php"><select name="family">';
foreach ($families as $family)
{
echo '<option value="' . $family . '">' . $family . '</option>';
}
echo '<input type="submit">' ;
echo '</select></form>' ;
}
QuaminaIT
0
Newbie Poster
Recommended Answers
Jump to PostAll you need to do is change $_POST to $_POST.
Jump to Posti don't understand the question, there's no problem populating the dropdown menu, i assume you mean how to echo the selected items from the dropdown menu? if that's the case then above post is right, change $_POST to $_POST
All 5 Replies
vaultdweller123
32
Posting Pro
grant.baker
10
Newbie Poster
vaultdweller123
32
Posting Pro
QuaminaIT
0
Newbie Poster
QuaminaIT
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.