Once again I am having problems between my development server and my live server. I have created a search page which works perfectly on my development server, running PHP 4.3.4 on IIS5.1 (WinXPPro) - however, when I put it on my live server, running PHP 4.3.4 on Linux, the search page does not work properly...
My code on the result page is as follows:
$varPriceEuroMin_rsProperties = "-1";
if (isset($_POST['propertyPriceEuroMin'])) {
$varPriceEuroMin_rsProperties = (get_magic_quotes_gpc()) ? $_POST['propertyPriceEuroMin'] : addslashes($_POST['propertyPriceEuroMin']);
}
$varPriceEuroMax_rsProperties = "-1";
if (isset($_POST['propertyPriceEuroMax'])) {
$varPriceEuroMax_rsProperties = (get_magic_quotes_gpc()) ? $_POST['propertyPriceEuroMax'] : addslashes($_POST['propertyPriceEuroMax']);
}
$varPropType_rsProperties = "-1";
if (isset($_POST['propertyType'])) {
$varPropType_rsProperties = (get_magic_quotes_gpc()) ? $_POST['propertyType'] : addslashes($_POST['propertyType']);
}
$varTown_rsProperties = "%";
if (isset($_POST['propertyTown'])) {
$varTown_rsProperties = (get_magic_quotes_gpc()) ? $_POST['propertyTown'] : addslashes($_POST['propertyTown']);
}
$varBedrooms_rsProperties = "-1";
if (isset($_POST['propertyBedrooms'])) {
$varBedrooms_rsProperties = (get_magic_quotes_gpc()) ? $_POST['propertyBedrooms'] : addslashes($_POST['propertyBedrooms']);
}
$varLivingSizeMin_rsProperties = "-1";
if (isset($_POST['propertyLivingSizeMin'])) {
$varLivingSizeMin_rsProperties = (get_magic_quotes_gpc()) ? $_POST['propertyLivingSizeMin'] : addslashes($_POST['propertyLivingSizeMin']);
}
$varLivingSizeMax_rsProperties = "-1";
if (isset($_POST['propertyLivingSizeMax'])) {
$varLivingSizeMax_rsProperties = (get_magic_quotes_gpc()) ? $_POST['propertyLivingSizeMax'] : addslashes($_POST['propertyLivingSizeMax']);
}
mysql_select_db($database_connCostaBlanca, $connCostaBlanca);
$query_rsProperties = sprintf("SELECT * FROM tblproperty WHERE propertyType >= %s AND propertyPriceEuro BETWEEN %s AND %s AND propertyTown LIKE '%s' AND propertyBedrooms >= %s AND propertyLivingSize BETWEEN %s AND %s ORDER BY propertyRef ASC", $varPropType_rsProperties, $varPriceEuroMin_rsProperties, $varPriceEuroMax_rsProperties, $varTown_rsProperties, $varBedrooms_rsProperties, $varLivingSizeMin_rsProperties, $varLivingSizeMax_rsProperties);
$query_limit_rsProperties = sprintf("%s LIMIT %d, %d", $query_rsProperties, $startRow_rsProperties, $maxRows_rsProperties);
$rsProperties = mysql_query($query_limit_rsProperties, $connCostaBlanca) or die(mysql_error());
$row_rsProperties = mysql_fetch_assoc($rsProperties);
I have a feeling the problem is being caused by the wildcard characters I am using on the search page (-1 for numbers and % for text) - I normally develop using ASP & VBScript, so PHP is relatively new to me...
Here is the page in question:
www.costablancarealestates.co.uk/new/property_search.php - bear in mind there is only sample data there at the moment (under Villa's)
Peter