I have been trying to get an HTML dropdown box with the values being passed over via POST to anoter .php
The dropdown box is meant to be filled with the data from a mySQL table, but after trawling online for about 4 hours, I have given up and now have made my way here
.The mySQL db is called jonnossi_Site and the table with the data (1 column, varchar(15)) is called characters.
The code I have so far (I am quite the noob at this so please ignore the bad coding :P :
- Code: Select all
<?php
include "../sys/security.php";
$FLTRpass=$_POST['FLTRpass'];
If($FLTRpass!="FLTRpass") {die ("incorrect password");}
?>
<HTML>
<BODY>
FILTER OPTIONS <br>
<form action="filtereddata.php" method="post">
<select name="charname">
<? include "connect.php";
$result=mysql_query("SELECT * FROM characters");
while($row=mysql_fetch_array($result))
{
// Here is where I can not seem to get the contents of the table 'characters' to be echoed in to the drop down box. I want them in the form of <option=$result[0]>$result[0]</option>......etc....etc...
}
?>
</select>
<input type="submit" value="Filter the Data">
</form>
</BODY>
</HTML>
Thank you for your time



!