Greetings,
Thanks to some helpful users on the forums, i’ve been able to get some custom advanced search/filtering working on my site. The problem is that while the search works with using the method of POST on my form html element, when I try to change it to GET (to show the search string in the URL so users can save it), the search no longer works. Here are some examples:
working, with POST: http://www.daybreakutah.com/homes/
not working, with GET: http://www.daybreakutah.com/test/homes/
The items that are different on the GET version are the method=“GET” on the form element, and i’ve changed the way I retrieve the variables when building my SQL query. Example:
<?php
$buildsql = "SELECT * FROM `exp_weblog_data` WHERE `weblog_id` = '1'";
// builder
$b = @$_GET['builder'];
$bsql = NULL;
if ($b == 0) { $bsql = "`field_id_9` IS NOT NULL"; }
if ($b == 1) { $bsql = "`field_id_9`='Bangerter Homes'"; }
if ($b == 2) { $bsql = "`field_id_9`='Destination Homes'"; }
if ($b == 3) { $bsql = "`field_id_9`='Garbett Homes'"; }
if ($b == 4) { $bsql = "`field_id_9`='Gold Medallion Homes'"; }
if ($b == 5) { $bsql = "`field_id_9`='Hamlet Homes'"; }
if ($b == 6) { $bsql = "`field_id_9`='Holmes Homes'"; }
if ($b == 7) { $bsql = "`field_id_9`='Ivory Homes'"; }
if ($b == 8) { $bsql = "`field_id_9`='Liberty Homes'"; }
if ($b == 9) { $bsql = "`field_id_9`='Rainey Homes'"; }
if ($b == 10) { $bsql = "`field_id_9`='Richmond American Homes'"; }
$buildsql = $buildsql." AND $bsql ";As you can see on the second link above, none of the selections from the form are being carried over to the search results page (i am printing out the SQL query on that page for testing). Any hints as to why POST would work, but GET wouldn’t?
Thanks for your help!
Pat