0
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>' ;

}
3
Contributors
5
Replies
6
Views
5 Years
Discussion Span
Last Post by QuaminaIT
1

i 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

Edited by vaultdweller123: n/a

0

All you need to do is change $_POST to $_POST.

I did that and now it just brings me back to the dropdown menu after I click submit.

0

You guys were a big help in me solving this minor issue. Instead of

echo $_POST['family'] ;

Its supposed to be

echo $POST['families'] ;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.