Drop down issues
Posted: Wed Jul 28, 2010 1:14 am
Hi I'm trying to write a drop down which on change gets a variable through refreshing the current page. I already use get for the page location and the code below is a page which is included as part of tabled index page.
However, when I change the drop down nothing happens.
However, when I change the drop down nothing happens.
Code: Select all
<?php
Echo "<div class='hide'><table><tr><td></div>";
$flow = '<form><select name="filter" onchange="index.php?location=auctionplayers.php" method="GET"><option value="*">All</option>';
$result = mysql_query ('SELECT DISTINCT Position FROM Player_Table') or die (mysql_error ());
while($row = mysql_fetch_array($result))
{
$flow .= '<option value=$filter"' . $row["Position"] . '">' . $row["Position"] . '</option>';
}
$result = mysql_query ('SELECT DISTINCT Club FROM Player_Table') or die (mysql_error ());
while($row = mysql_fetch_array($result))
{
$flow .= '<option value="' . $row["Club"] . '">' . $row["Club"] . '</option>';
}
$flow .= '</select></form>';
Echo $flow;
echo "<table><tr><th>Ref</th><th>Name</th><th>Club</th><th>Pos</th><th>Last Season Points</th></tr>";
$result = mysql_query ('SELECT ' . $filter . ' FROM Player_Table') or die (mysql_error ());
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Ref'] . "</td>";
echo "<td>" . $row['Name'] . "</td>";
echo "<td>" . $row['Club'] . "</td>";
echo "<td>" . $row['Position'] . "</td>";
echo "<td>" . $row['Last_Year_Points'] . "</td>";
echo "</tr>";
}
echo "</table>";
Echo "</td><td>spare cell</td></table>";
?>