Hello.
I've been consulting this forum some time now but never posted a question as yet.
But here I start.
I have a _list.php with business addresses (table = BA) and other items.
I inserted a php_snippet in the _list.php with 3 dropdown boxes with values from 3 different tables (none of which being the _list.page table)
I would like to dynamically filter the _list.page based on the values selected in those 3 dropdown boxes.
I have this code yet: **
$str1 = "";
$str1.="<select size=3 name=\"criteria1\" id=\"criteria1\"><option value=\"\">pcode</option>";
$str2 = "";
$str2.="<select size=3 name=\"criteria2\" id=\"criteria2\"><option value=\"\">lease_sale</option>";
$str3 = "";
$str3.="<select size=3 name=\"criteria3\" id=\"criteria3\"><option value=\"\">off_ind</option>";
//
global $conn;
$strSQL1 = "select distinct check1 from table1";
$rs1 = db_query($strSQL1,$conn);
while ($data = db_fetch_array($rs1))
$str1.="<option value=".$data['check1'].">".$data['check1']."</option>";
$str1.="</select>";
$strSQL2 = "select distinct check2 from table2";
$rs2 = db_query($strSQL2,$conn);
while ($data = db_fetch_array($rs2))
$str2.="<option value=".$data['check2'].">".$data['check2']."</option>";
$str2.="</select>";
$strSQL3 = "select distinct check3 from table3";
$rs3 = db_query($strSQL3,$conn);
while ($data = db_fetch_array($rs3))
$str3.="<option value=".$data['check3'].">".$data['check3']."</option>";
$str3.="</select>";
// form
echo '<form action='.$_SERVER["PHPSELF"].' method="post">';
echo $str1."".$str2."".$str3."";
echo '<input type="submit" name="submit" value="continue" />';
echo '</form>';
if (isset($_POST['submit']))
{
$_SESSION["crit1"] = $_POST['criteria1'];
$_SESSION["crit2"] = $_POST['criteria2'];
$_SESSION["crit3"] = $_POST['criteria3'];
}
$strWhereClause = "BA_field1=".$_SESSION["crit1"]." and " . "BA_field2 =".$_SESSION["crit2"]." and ". "BA_field3 =".$_SESSION["crit3"];
[color="#006400"]// Who can help me further with this ?
Many thanks.