I was following one example given on this site that was explaining the 'explode' method of extracting 2 values from a drop-down list, filled dynamically from a database. When I was just trying to get 1 value, this all worked, but I realized I needed to extract more values from the 1 selection from the drop-down. I am trying the 'pipe-explode' method, as you can see, but it is returning nothing. No error, just nothing, not even the 'echo' in the 'isset' function. Any thoughts?
$verbs = mysqli_query($dbc, "SELECT * FROM verblist WHERE person = '1s'");
echo'<form method="post">
<select id="verbList" class="dropdownObj" name="verbList">
<option>Choose a Verb</option>
';
while ($row = mysqli_fetch_assoc($verbs)){
echo'<option value="'.$row['mainVerb'].'|'.$row['form'].'">'.$row['mainVerb'].' - form '.$row['form'].'</option>';
}
echo'</select>
<input type="submit" name="verbSubmit" value="Start Game">
</form>
';
if(isset($_POST['submit'])){
$selectedVerb = $_POST['verbList'];
$result_explode = explode('|', $selectedVerb);
echo'Your verb selection: <b>'. $result_explode[0] .'</b> and form: <b>'. $result_explode[1] .'</b><br>';
}