I have the code shown below that nicely fills a Combobox but I have no idea how to have it on a form so that the user can select an item and the resulting $_POST would be availabe to another page the same way it would be if the Combobox had been filled at programming time. Can anyone help?
If it can be done another way, making $_SESSION = the "selected username" for instance, would be acceptable.
connect2DB();
$result = mysql_query("SELECT * FROM Members ORDER BY name ") or die("Unable to query ");
mysql_close();
echo "<select name=username value=''>username Name</option>";
while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[id]>$nt[name]</option>";
}
echo "</select>";
<div id="wb_Form2" style="position:absolute;width:329px;height:75px;">
<form name="LoginForm" method="post" action="verify.php" id="Form2">
<select name="username" size="1" id="Combobox1" style="position:absolute;left:96px;top:9px;width:163px;height:22px;z-index:1;">
<option>Select your name</option>
<option value="John Doe">John Doe</option>
But about 12 names loaded from Mysql database instead.
</select>
<input type="text" id="Editbox1" style="position:absolute;left:107px;top:44px;width:148px;height:18px;line-height:18px;z-index:2;" name="password" value="">
<input type="submit" id="Button2" name="" value="Login" style="position:absolute;left:267px;top:10px;width:51px;height:54px;z-index:3;">
<div id="wb_Text1" style="position:absolute;left:3px;top:4px;width:92px;height:32px;z-index:4;">
<span style="color:#000000;font-family:Arial;font-size:27px;"><strong>Login:</strong></span></div>
<input type="button" id="Button1" onclick="window.location.href='http://www.dubelou.com/ccmen/Forum.php'; ;return false;" name="" value="Forum" style="position:absolute;left:8px;top:42px;width:71px;height:25px;z-index:5;">
</form>
</div>