On a search page there is a UK map with a link for each region e.g:
<area shape="poly" coords="104,392,109,387,138,361,146,381,120,390,119,396,113,392,105,392" href="dealers_script.php?region=Cornwall" alt="Cornwall" title="Cornwall">
The problem is that I cannot get the first ifelse to work (shown below) i.e. the GET region if statement does not pass the value to the distanceUK function so theres a problem with the query.
The search results go by postcode therefore there has to be a query from region name to get postcode.
Ive tried debugging this for ages but with no luck.
This is the script for a dealer search page.
Thanks anyone
if(isset($_POST['postcode_dropdown']))
{
$postcode = $_POST['postcode_dropdown'];
getDistanceUK($postcode,100);
}
elseif(isset($_GET['region']))
{
$region = $_GET['region'];
$region_sql = "SELECT postcode_1 FROM dealers WHERE dealer_region='$region'";
$region_sql_result = mysql_query($region_sql);
$row = mysql_fetch_array($region_sql_result);
$postcode = $row['postcode_1'];
getDistanceUK($postcode,100);
}
elseif(isset($_POST['postcode']))
{
$postcode = $_POST['postcode'];
getDistanceUK($postcode,100);
}
elseif(isset($_GET['postcode']))
{
$postcode = $_GET['postcode'];
getDistanceUK($postcode,100);
}