bonjour a tous, je suis le webmaster de http://vente-location.fr
je recherche vos avis sur le montage d'un petit bou de code pour
mon moteur de recherche.
Explication :
je cherche a proposer une recherche par un seul IMPUT du style :
"acheter une maison" au lieu de coché la case "acheter" et "Maison",
ou case "location" et "Maison".
avant de finir mon code dans la totalité pouvez vous me dire ci je doit
poursuivre ou y a t'il plus simple ou autre idée ?
mon debut de code :
dans se début de code j'ai juste fait pour par exemple :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 $texterecherche = trim(@$_GET['texterecherche']); $texterecherche = str_replace(", ", " ", $texterecherche); $texterecherche = str_replace(",", " ", $texterecherche); $texterecherche = str_replace("; ", " ", $texterecherche); $texterecherche = str_replace(";", " ", $texterecherche); $texterecherche = str_replace("+", " ", $texterecherche); $texterecherche = str_replace("\"", " ", $texterecherche); $texterecherche = str_replace("'", "", $texterecherche); $texterecherche = str_replace(":", " ", $texterecherche); $tab=explode(" " , $texterecherche); if ($tab[0]=='louer' || $tab[0]=='loué' || $tab[0]=='loue' || $tab[0]=='location' || $tab[0]=='locations') { if ($tab[1] == 'un' || $tab[1] == 'une' || $tab[1] == 'dun' || $tab[1] == 'dune') { if ($tab[2] == 'appartement') { $query_search .= " AND products.section = '32'";} if ($tab[2] == 'apartement') { $query_search .= " AND products.section = '32'";} if ($tab[2] == 'maison') { $query_search .= " AND products.section = '33'";} if ($tab[2] == 'villa') { $query_search .= " AND products.section = '33'";} }}
"louer un appartement" avec divers possibilitées...
Je doit continuer pour toute les possibilitée de recherche pour etre complé.
quesque vous en pensez ?
Partager