I'm working on a project, a game, and right now my main issue, though minor is annoying none the less.
Users have a list of monsters to choose from, in a drop down box which is populated by the database and ordered by monster level.
print "<center>";
print "<table width=\"512\" cellpadding=\"5px\" align=\"center\" border=\"1\" style=\"border-style:dashed; border-width:thin; border-collapse:collapse;\" cellspacing=\"0px\">";
print "<tr><td><center>$location</td></center><td>Inventory</tr>";
print "<tr><td>";
print "<center>";
print "Select the monster you would like to attack:<br /><br>";
print "<form action=\"killmonster.php\" method=\"post\">";
print "<select name=\"monstername\" length=\"20\">";
$command3 = "SELECT * from ext_monsters order by lvl asc";
$query3 = mysql_query($command3)
or die($db_error);
while ($monster = mysql_fetch_array($query3))
{
print "<option value=\"".$monster['name']."\">".$monster['name']."</option>";
}
print "</select><br><br />";
print "<input type=\"hidden\" name=\"monsterhp\" value=\"0\" />";
print "<input type=\"submit\" name=\"submit\" value=\"Attack Monster!\">";
print "<br /><br />";
$command5 = "SELECT * from ext_users where playername='$player'";
$query5 = mysql_query($command5)
or die($db_error);
$result4 = mysql_fetch_array($query5);
This is my form for selecting a monster.
Now my question is, how do I get the form to hold onto the last option(Monster) that the user chose, so that they don't have to go back to the drop down and find the monster again, as the list is large.