I have a list box with the first and lastnames and the when I submit this form it echoes the ID# not the value selected.
I have tried this with other variables and worked fine
Here it is:
<form id="form1" name="form1" method="post" action="test.php">
<?
$connection = @mysql_connect("localhost", "root") or die("Could not Connect to Database Server");
$db = @mysql_select_db("move_db", $connection) or die("Could Not Select Database");
$sql = "SELECT ID, FirstName, LastName FROM employees WHERE Position = 'Collector' ORDER BY LastName ";
$result = @mysql_query($sql, $connection) or die("Could Not Execute Query");
echo '<select name = "employ1"><option value="0">- Collector -</option>';
while ($row = mysql_fetch_array($result)) {
$id = $row['ID'];
$fname= $row['FirstName'];
$lname = $row['LastName'];
echo "<option value= \"$id\">$lname, $fname</option>\n";
}
echo '</select>';
?>
<input type="submit" name="Submit" value="Submit" />
</form>
Here is the test.php
<title>Untitled Document</title>
</head>
<? echo $_POST["employ1"]; ?>
<body>
</body>
</html>