I posted a question earlier about trouble with my select menu, but I think the problem I'm having is that the choice that the user makes from the drop down menu isn't being exploded properly.
Here's the scoop:
I have a dynamically generated array that populates a drop down menu. The user makes his choice and submits the form moving on to the next page.
I put some code into this to separate the choice into two variables: $Category and $Topic.
The problem is that no matter what choice the user makes, the form always passes the last choice in the drop down menu from the previous page.
I think it's because the explode is not working correctly so it's taking the last option each time instead of the user's selection.
The code I'm using is below. Any ideas of how to fix this so the choice made by the user is the info that's passed to the next page?
Thanks very much,
Rick
<select name="GamesInProgress">
<?
/****************************************
This portion of the script sorts and loops through the array to populate the drop down menu
****************************************/
sort($PlayArray);
foreach ($PlayArray as $PlayInProgress) {
echo '<option>' . $PlayInProgress . '</option>';
}
$ContinuedGame = Array();
$ContinuedGame = explode ("-",$PlayInProgress);
$Category=trim($ContinuedGame[0]);
$Topic=trim($ContinuedGame[1]);
?>
</select>