Hi, this is probably a pretty simple question for you pro's but would appreciate some help as I have ogtten stuck.
I have a html form
<html>
<body>
<form action="com.php" method="post">
Firstname: <input type="text" name="firstname" />
Lastname: <input type="text" name="lastname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
<form action="com.php" method="post">
<p><select size="1" name="firstname">
<option value="Glenn">Glenn</option>
<option value="two">two</option>
<option value="three">three</option>
</select></p>
<p><select size="1" name="lastname">
<option value="Bry">Bry</option>
<option value="Dave">Dave</option>
<option value="Andy">Andy</option>
</select></p>
<p><input type="submit"></p>
</form>
</body>
</html>
which posts to the selected values to mySql via php
mysql_query($sql,$con);
$sql="INSERT INTO Persons (FirstName, LastName, Age)
VALUES
('$_POST[firstname]','$_POST[lastname]','$_POST[age]')";
$result = mysql_query("SELECT * FROM Persons
WHERE FirstName= '[B]Glenn'[/B]");
while($row = mysql_fetch_array($result))
{
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br />";
}
This then displays what resides in the database. But what I want to do is change the 'Glenn' which is in red, to the variable selected in the drop down box in the html. Ive tried lots of things to set this variable but i just cannot seem to crack it. What should i replace 'Glenn' with?