
October 21st, 2003, 06:41 PM
|
|
Contributing User
|
|
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192
Time spent in forums: < 1 sec
Reputation Power: 6
|
|
|
php drop down menu
i made this simple thing to get a query from the database and display it in a drop down menu... i cant seem to be able to get the proper id for what i have selected...any suggestions...
PHP Code:
echo "<select name=\"hello>";
echo "<option value=\"\"></option>";
$query = "SELECT * FROM headings";
$result = mysql_query ($query);
while ($row=mysql_fetch_array($result)) {
$head=$row["id"];
$title=$row["title"];
$description=$row["description"];
echo "<option value=\"$head\">$head</option>";
}
echo "</select>";
echo "<div id=\"addForum\">";
echo "<form name=\"post\" action=\"index.php?page=./forums/index&head=$head&action=forumAdd\" method=\"POST\"><br>";
echo "Forum Name:<br><input type=\"text\" value=\"\" name=\"forumName\"><br><br>";
echo "Description:<br><textarea id=\"replyTextArea\" name=\"description\" rows=\"2\" cols=\"50\" wrap=\"virtual\"></textarea><br>";
echo "<input type=\"submit\" name=\"submit\" class=\"submit\" value=\"REPLY\">";
echo "</form>";
echo "</div>";
|