Forms and While Loop
| From: | Wayne Michel | Date: | Wed, 01 Nov 2000 22:37:01 +0000 |
| Subject: | Forms and While Loop | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-23261@lists.php.net to get a copy of this message | ||
I am trying to produce a drop-down list. Relevant (I think) code follows:
echo "<p><form method=\"post\"
action=\"$Relative/items.php?CA=$CatID&UID=$UID\"><select
name=\"CatList\" size=\"1\">";
while ($row = mysql_fetch_row($result))
{
$Cat=$row[0];
$CatID=$row[1];
echo "<option value=\"$row[0]\"> $row[0] </option>";
}
echo "</select><input type=\"submit\" name=\"Submit\"
value=\"Go to
Category\"></p></form>";
It all works well except the variable $Cat is not showing in the action
line. I have to get it to work with various layouts, but I am at an
impasse. As a new PHP coder, I try to think it through, but this time I am
stuck.
Can anyone show me how to get the variable $Cat, inside the loop, to appear
in the action line.
Thanks