Forum Moderators: coopster
Parse error: parse error, unexpected '=', expecting ',' or ')' in /home/uaeletti/public_html/results.php on line 14
.
The code is below. Could anyone please assist?
Many thanks,
Alex.
<?php
$currentPage = $_SERVER["PHP_SELF"];
$maxRows_Prop_Search = 10;
$pageNum_Prop_Search = 0;
if (isset($_GET['pageNum_Prop_Search'])) {
$pageNum_Prop_Search = $_GET['pageNum_Prop_Search'];
}
$startRow_Prop_Search = $pageNum_Prop_Search * $maxRows_Prop_Search;
$location_Prop_Search = "%";
if (isset(#location#)) {
$location_Prop_Search = (get_magic_quotes_gpc())? #location# : addslashes(#location#);
}
$emirate_Prop_Search = "%";
if (isset(#emirate#)) {
$emirate_Prop_Search = (get_magic_quotes_gpc())? #emirate# : addslashes(#emirate#);
}
$lengthofstay_Prop_Search = "%";
if (isset(#lengthofstay#)) {
$lengthofstay_Prop_Search = (get_magic_quotes_gpc())? #lengthofstay# : addslashes(#lengthofstay#);
}
$furnishing_Prop_Search = "%";
if (isset(#furnishing#)) {
$furnishing_Prop_Search = (get_magic_quotes_gpc())? #furnishing# : addslashes(#furnishing#);
}
$noofbeds_Prop_Search = "%";
if (isset(#noofbeds#)) {
$noofbeds_Prop_Search = (get_magic_quotes_gpc())? #noofbeds# : addslashes(#noofbeds#);
}
?>
[edited by: coopster at 5:55 pm (utc) on Feb. 23, 2006]
[edit reason] removed unnecessary code [/edit]
insted use 'var' OR "var"
so you rcode might look like :
if (isset('location')) {
$location_Prop_Search = (get_magic_quotes_gpc())? 'location' : addslashes('location');
if (location) is a var
if (isset($location)) {
$location_Prop_Search = (get_magic_quotes_gpc())? $location : addslashes($location);
I think this might be the reason... give it a try and see what will happen
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_VARIABLE or '$' in /home/uaeletti/public_html/results.php on line 13
Any further ideas?
Your help is much appreciated!
Actually, variable names start with a dollar sign. You got your first edit check correct on the 'pageNum_Prop_Search' index of the $_GET superglobal, but then you went off track with the rest. You need to alter all those after the first one to look like the first one, assuming the 'location' variable and others are part of the QUERY_STRING.