Hi there,
i am trying to create an advanced search results page.
can anyone tell me what the problem is with this code.
i have been sucessful using ASP, by using Request.Form("Area") in the Run-time Value. I think this is where the problem lies. I'm pretty sure i read somewhere that you replace("Area") with (#Name#), but what is the equivalant of Request.Form in PHP??
Many thanks in advance!
Jas --
<?php require_once('Connections/search.php'); ?>
<?php
$varName_rsFields = "%";
if (isset(#Name#)) {
__$varName_rsFields = (get_magic_quotes_gpc()) ? #Name# : addslashes(#Name#);
}
$varAge_rsFields = "%";
if (isset(#Age#)) {
__$varAge_rsFields = (get_magic_quotes_gpc()) ? #Age# : addslashes(#Age#);
}
mysql_select_db($database_search, $search);
$query_rsFields = sprintf("SELECT * FROM searchFields WHERE name = '%s' AND age >= '%s'", $varName_rsFields,$varAge_rsFields);
$rsFields = mysql_query($query_rsFields, $search) or die(mysql_error());
$row_rsFields = mysql_fetch_assoc($rsFields);
$totalRows_rsFields = mysql_num_rows($rsFields);
?>