[php]<?php
$resultsxml = xml_read(‘projecten.xml’);
$resultsxml = $resultsxml[‘result’];
$getLocatie = $_POST[‘location’];
$getFase = $_POST[‘fase’];
$getBor = $_POST[‘buyorrent’];
$last_results = array();
if(isset($getLocation)){
$last_results = resultFilter($getLocation,$resultsxml);
}else{$last_results = $resultsxml;}
if(isset($getFase)){
$last_results = resultFilter($getFase,$last_results);
}else{
if(empty($getLocatie)){
$last_results = $resultsxml;
}
}
if(isset($getBor)){
if($getBor != "both"){
if($getBor== "buy"){
$fase = "For Sell";
}else if($getBor == "rent"){
$fase = "For Rent";
}
$last_results = filterProjects($last_results, $fase);
}
}
[/php]
This code is used for a real estate website.
A house can have 3 stats the ‘buyorrent’: Rent, Sell, Both.
When you give the command to search for: rent it works fine.
when you give the command to search for: sell it works fine.
when you give the command to search for: both it works fine.
The problem is, that when you search for: rent, it wont display a real estate project that is marked “both” meaning rent and sell.
The same happends when you search for: buy, it wont display a real estate project that is marked “both” meaning rent and sell.
i aint no php-magic kid. i tried tough. red several tutorials about php but it wouldnt work. i think i figured out that the problem lies in this piece of code.
[php]if(isset($getBor)){
if($getBor != "both"){
if($getBor== "buy"){
$fase = "For Sell";
}else if($getBor == "rent"){
$fase = "For Rent";
}[/php]
Can anyone help me fix the code? So that when a command to search for rent or sell, it will display projects marked as “both” meaning rent and sell.
Thanks in advance!