I have some links
display.php?location=london
display.php?location=north
display.php?location=north&east
display.php?location=south
display.php?location=south&east
etc etc
these should then pull out users from my database based on the area they are in ie london or north east. However it isnt working correctly its pulling out all of the users from all areas the code for the display.php page is below could you please help me rewrite it or get it working?
<?php
include "common.php";
$link = mysql_connect("$server", "$username", "$password")
or die("Could not connect");
mysql_select_db("$db") or die("Could not select database");
$location = $_POST["location"];
$result = mysql_query("SELECT * FROM user WHERE location = '$location'");
echo "<table align=center><tr><td><font face=arial size=2>Escort</td><td><font face=arial size=2></td><td><font face=arial size=2>City</td><td><font face=arial size=2>Age</td></tr>";
while ($i = mysql_fetch_array($result)) {
echo "<tr><td><font face=arial size=2><a href=view.php?id=".$i[id].">".$i[user]."</a></td><td><font face=arial size=2>".$i[location]."</td><td><font face=arial size=2>".$i[city]."</td><td><font face=arial size=2>".$i[age]."</td></tr>";
}
echo "</table>";
?>