hi, am pretty knew to php, and am not sure how to pass a variable out of a dropdown list/menu. the dropdown itself is generated by this function:
//function for dropdown list
function create_dropdown($identifier, $pairs, $firstentry)
{
//start dropdown list with the <select> element and title
$dropdown = "<select name=\"$identifier\"\">";
$dropdown .= "<option name=\"\">$firstentry</option>";
//create the dropdown elements
foreach($pairs AS $value => $name)
{
$dropdown .= "<option name=\"$value\">$name</option>";
}
//conclude the dropdown and return it
echo "</select>";
return $dropdown;
}
and the function is called here:
<?php require_once("includes/connection.php"); ?>
<?php require_once("includes/functions.php"); ?>
<?php
//retrieve the table data
$query = "SELECT id, termin FROM smbTermine ORDER BY id";
$result = mysql_query($query);
//create an associative array based on the table data
while($row = mysql_fetch_array($result))
{
$value = $row["id"];
$name = $row["termin"];
$pairs["$value"] = $name;
}
echo "Current Performances are: <br />";
//echo create_dropdown("language", $pairs, "choose one:");
echo create_dropdown2("language", $pairs, "choose one:", "", 1);
?>
my question is, when a user has chosen one of the dropdown choices, how would i pass the information on so that i can delete the chosen entry from mysql? (in other words, once a dropdown choice is chosen, how do i address which entry was chosen?).