How do I get the value in the combo box and store it in a variable? And use the variable in another PHP file? Here is my code.
Note: I am already able to get data from database and store it in the combo box.
$con = mysql_connect("localhost","root","aaaa");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("maptemp", $con);
$sql = "SELECT * FROM users";
$rs = mysql_query($sql) or die(mysql_error());
$selectbox='<select name=\'userst\'>';
while ($row = mysql_fetch_assoc($rs)) {
$selectbox.='<option value=\"' . $row['username'] . '\">' . $row['username'].'</option>';
}
$selectbox.='</select>';
mysql_free_result($rs);
echo $selectbox;