 |
|
| Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more. |
|
 |
|

02-17-2012, 04:35 PM
|
 |
Super Moderator
|
|
Join Date: 02-10-07
Location: Central Kentucky
Posts: 10,080
|
|
|
No I think you may be green but right. Does that make sense?
|

02-18-2012, 02:21 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
Quote:
Originally Posted by ScriptMan
Are you trying to repopulate the search box or do you want to use them internally somehow?
As a quick note your session is created by the search page mine was PHPSESSID=102efef40e64f22995233fe540cd8a6e and the URL contained all the data needed for extraction.
Of course clicking on the link took me right to the listing so you must be trying to repopulate the search box? Why else would you need to do anything?
Help me understand here.
|
Yeah exactly that. I don't know if you noticed but I'm currently opening the properties up in _blank windows. The only reason I'm doing this is because the property page drops the search fields so I offer them the chance to get back to their results without having to fill the form in again. Ideally I want users to always be navigating in one window and for it to hold there search preferences. I hope that makes sense.
|

02-18-2012, 02:25 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
Quote:
Originally Posted by an0n
ScriptMan I am reading it as if he wants to repopulate the dropdown.
Wouldn't it be
Property Type:<br />
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ($_SESSION['TYPE'] == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="apartment"<?php echo ($_SESSION['TYPE'] == 'apartment') ? ' selected="selected"' : ''; ?>>Apartment</option>
<option value="villa"<?php echo ($_SESSION['TYPE'] == 'villa') ? ' selected="selected"' : ''; ?>>Villa</option>
<option value="townhouse"<?php echo ($_SESSION['TYPE'] == 'townhouse') ? ' selected="selected"' : ''; ?>>Townhouse</option>
</select>
Changing all of those $_GET's to $_SESSIONS ?
I mean afterall he is checking for values.
Smack me if I am out of line here 
|
A fresh approach! But with the same outcome! I just tried that but it's not working either!  Problem is, I've been changing the code so many times in attempt to get it to work so I'm probably even further away now than when I started! haha
|

02-19-2012, 05:56 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
|
|
OK, so at least we are definitive with where you are going with this.
IMHO, I think you should kill the PHPSESSIONID via .htaccess
add this:
Code:
php_flag session.use_trans_sid off
But regardless of that, with the code above in place, everything selected via the dropdowns DO maintain their respective values, at least over here on my end.
|

02-19-2012, 06:00 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
Quote:
Originally Posted by an0n
OK, so at least we are definitive with where you are going with this.
IMHO, I think you should kill the PHPSESSIONID via .htaccess
add this:
Code:
php_flag session.use_trans_sid off
But regardless of that, with the code above in place, everything selected via the dropdowns DO maintain their respective values, at least over here on my end.
|
Cheers for that little tip, I'll add it to my .htaccess!
But it's not retaining the values from for-rent-nerja.com/search.php to for-rent-nerja.com/property.php on my side. Are you seeing something different?
|

02-19-2012, 06:08 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
|
|
|
They are separate php files.
Change the code in the property.php as you did for the search.php.
Change all of those $_GET to $_SESSION
You see, when you are clicking the 'view apartment' you aren't resubmitting a form.
We are getting the initial values via a submission of the search.php form which we then assign to our session variables for use in other files.
Therefore nothing is going to stick, unless you are pulling out your sessions values into the respective php files that you are using.
One question I ask is: Is that side search coming via an include file? Or has it been coded in every single php file?
|

02-19-2012, 06:25 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
OK well I've been working through some different code but not sure if that's gonna make a difference to what you're saying so I'll just double check.
I've got this on my search.php page:
PHP Code:
<?php session_start(); if(isset($_GET['submit'])) $_SESSION['get']=$_GET; ?>
PHP Code:
<form action="http://www.for-rent-nerja.com/search.php" method="get" name="search" id="search" style="background-color:#fcf5f8">
<span class="t_color3"><u><b>Property Search</b></u></span><br />
<br />
Property Ref:<br />
<input type="text" size="15" id="REF" name="REF" /><br />
Property Type:<br />
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ($_GET['TYPE'] == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="apartment"<?php echo ($_GET['TYPE'] == 'apartment') ? ' selected="selected"' : ''; ?>>Apartment</option>
<option value="villa"<?php echo ($_GET['TYPE'] == 'villa') ? ' selected="selected"' : ''; ?>>Villa</option>
<option value="townhouse"<?php echo ($_GET['TYPE'] == 'townhouse') ? ' selected="selected"' : ''; ?>>Townhouse</option>
</select>
<br />
Duration:<br />
<select id="DURATION" name="DURATION" style="width: 120px">
<option value="holiday"<?php echo ($_GET['DURATION'] == 'holiday') ? ' selected="selected"' : ''; ?>>Holiday</option>
<option value="long term"<?php echo ($_GET['DURATION'] == 'long term') ? ' selected="selected"' : ''; ?>>Long Term</option>
<option value="sale"<?php echo ($_GET['DURATION'] == 'sale') ? ' selected="selected"' : ''; ?>>Sale</option>
</select>
<br />
Town:<br />
<select id="AREA" name="AREA" style="width: 120px" onchange="onRegionChange()">
<option value="Nerja"<?php echo ($_GET['AREA'] == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
<option value="Torrox"<?php echo ($_GET['AREA'] == 'Torrox') ? ' selected="selected"' : ''; ?>>Torrox</option>
<option value="Frigiliana"<?php echo ($_GET['AREA'] == 'Frigiliana') ? ' selected="selected"' : ''; ?>>Frigiliana</option>
<option value="Maro"<?php echo ($_GET['AREA'] == 'Maro') ? ' selected="selected"' : ''; ?>>Maro</option>
</select>
<div id="allForms">Area:<br />
<select id="REGION" name="REGION" style="width: 120px">
<option value=""<?php echo ($_GET['REGION'] == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="Central"<?php echo ($_GET['REGION'] == 'Central') ? ' selected="selected"' : ''; ?>>Central</option>
<option value="Burriana"<?php echo ($_GET['REGION'] == 'Burriana') ? ' selected="selected"' : ''; ?>>Burriana</option>
<option value="Capistrano"<?php echo ($_GET['REGION'] == 'Capistrano') ? ' selected="selected"' : ''; ?>>Capistrano</option>
<option value="Torrecilla"<?php echo ($_GET['REGION'] == 'Torrecilla') ? ' selected="selected"' : ''; ?>>Torrecilla</option>
<option value="Punta Lara"<?php echo ($_GET['REGION'] == 'Punta Lara') ? ' selected="selected"' : ''; ?>>Punta Lara</option>
<option value="Parador"<?php echo ($_GET['REGION'] == 'Parador') ? ' selected="selected"' : ''; ?>>Parador</option>
<option value="Carabeo"<?php echo ($_GET['REGION'] == 'Carabeo') ? ' selected="selected"' : ''; ?>>Carabeo</option>
<option value="Las Minas"<?php echo ($_GET['REGION'] == 'Las Minas') ? ' selected="selected"' : ''; ?>>Las Minas</option>
<option value="La Noria"<?php echo ($_GET['REGION'] == 'La Noria') ? ' selected="selected"' : ''; ?>>La Noria</option>
<option value="Tamango Hill"<?php echo ($_GET['REGION'] == 'Tamango Hill') ? ' selected="selected"' : ''; ?>>Tamango Hill</option>
<option value="Countryside"<?php echo ($_GET['REGION'] == 'Countryside') ? ' selected="selected"' : ''; ?>>Countryside</option>
</select>
</div>
Bedrooms:<br />
<select id="BEDROOMS" name="BEDROOMS" style="width: 120px">
<option value="1 bedroom"<?php echo ($_GET['BEDROOMS'] == '1 bedroom') ? ' selected="selected"' : ''; ?>>1</option>
<option value="2 bedroom"<?php echo ($_GET['BEDROOMS'] == '2 bedroom') ? ' selected="selected"' : ''; ?>>2</option>
<option value="3 bedroom"<?php echo ($_GET['BEDROOMS'] == '3 bedroom') ? ' selected="selected"' : ''; ?>>3</option>
<option value="4 bedroom"<?php echo ($_GET['BEDROOMS'] == '4 bedroom') ? ' selected="selected"' : ''; ?>>4</option>
<option value="5 bedroom"<?php echo ($_GET['BEDROOMS'] == '5 bedroom') ? ' selected="selected"' : ''; ?>>5+</option>
</select>
<br />
<br />
<input name="submit" type="submit" class="text1" value=
"Submit" />
<input type="reset" name="Clear" value="Reset" class=
"text1" />
</form>
and this on my property.php page:
PHP Code:
<?php session_start(); if(isset($_SESSION['get'])) $_GET=array_merge($_GET,$_SESSION['get']); ?>
PHP Code:
<form action="http://www.for-rent-nerja.com/search.php" method="get" name="search" id="search" style="background-color:#fcf5f8">
<span class="t_color3"><u><b>Property Search</b></u></span><br />
<br />
Property Ref:<br />
<input type="text" size="15" id="REF" name="REF" /><br />
Property Type:<br />
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ($_SESSION['TYPE'] == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="apartment"<?php echo ($_SESSION['TYPE'] == 'Apartment') ? ' selected="selected"' : ''; ?>>Apartment</option>
<option value="villa"<?php echo ($_SESSION['TYPE'] == 'Villa') ? ' selected="selected"' : ''; ?>>Villa</option>
<option value="townhouse"<?php echo ($_SESSION['TYPE'] == 'Townhouse') ? ' selected="selected"' : ''; ?>>Townhouse</option>
</select>
<br />
Duration:<br />
<select id="DURATION" name="DURATION" style="width: 120px">
<option value="holiday"<?php echo ($_SESSION['DURATION'] == 'holiday') ? ' selected="selected"' : ''; ?>>Holiday</option>
<option value="long term"<?php echo ($_SESSION['DURATION'] == 'long term') ? ' selected="selected"' : ''; ?>>Long Term</option>
<option value="sale"<?php echo ($_SESSION['DURATION'] == 'sale') ? ' selected="selected"' : ''; ?>>Sale</option>
</select>
<br />
Town:<br />
<select id="AREA" name="AREA" style="width: 120px" onchange="onRegionChange()">
<option value="Nerja"<?php echo ($_SESSION['AREA'] == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
<option value="Torrox"<?php echo ($_SESSION['AREA'] == 'Torrox') ? ' selected="selected"' : ''; ?>>Torrox</option>
<option value="Frigiliana"<?php echo ($_SESSION['AREA'] == 'Frigiliana') ? ' selected="selected"' : ''; ?>>Frigiliana</option>
<option value="Maro"<?php echo ($_SESSION['AREA'] == 'Maro') ? ' selected="selected"' : ''; ?>>Maro</option>
</select>
<div id="allForms">Area:<br />
<select id="REGION" name="REGION" style="width: 120px">
<option value=""<?php echo ($_SESSION['REGION'] == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="Central"<?php echo ($_SESSION['REGION'] == 'Central') ? ' selected="selected"' : ''; ?>>Central</option>
<option value="Burriana"<?php echo ($_SESSION['REGION'] == 'Burriana') ? ' selected="selected"' : ''; ?>>Burriana</option>
<option value="Capistrano"<?php echo ($_SESSION['REGION'] == 'Capistrano') ? ' selected="selected"' : ''; ?>>Capistrano</option>
<option value="Torrecilla"<?php echo ($_SESSION['REGION'] == 'Torrecilla') ? ' selected="selected"' : ''; ?>>Torrecilla</option>
<option value="Punta Lara"<?php echo ($_SESSION['REGION'] == 'Punta Lara') ? ' selected="selected"' : ''; ?>>Punta Lara</option>
<option value="Parador"<?php echo ($_SESSION['REGION'] == 'Parador') ? ' selected="selected"' : ''; ?>>Parador</option>
<option value="Carabeo"<?php echo ($_SESSION['REGION'] == 'Carabeo') ? ' selected="selected"' : ''; ?>>Carabeo</option>
<option value="Las Minas"<?php echo ($_SESSION['REGION'] == 'Las Minas') ? ' selected="selected"' : ''; ?>>Las Minas</option>
<option value="La Noria"<?php echo ($_SESSION['REGION'] == 'La Noria') ? ' selected="selected"' : ''; ?>>La Noria</option>
<option value="Tamango Hill"<?php echo ($_SESSION['REGION'] == 'Tamango Hill') ? ' selected="selected"' : ''; ?>>Tamango Hill</option>
<option value="Countryside"<?php echo ($_SESSION['REGION'] == 'Countryside') ? ' selected="selected"' : ''; ?>>Countryside</option>
</select>
</div>
Bedrooms:<br />
<select id="BEDROOMS" name="BEDROOMS" style="width: 120px">
<option value="1 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '1 bedroom') ? ' selected="selected"' : ''; ?>>1</option>
<option value="2 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '2 bedroom') ? ' selected="selected"' : ''; ?>>2</option>
<option value="3 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '3 bedroom') ? ' selected="selected"' : ''; ?>>3</option>
<option value="4 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '4 bedroom') ? ' selected="selected"' : ''; ?>>4</option>
<option value="5 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '5 bedroom') ? ' selected="selected"' : ''; ?>>5+</option>
</select>
<br />
<br />
<input name="submit" type="submit" class="text1" value=
"Submit" />
<input type="reset" name="Clear" value="Reset" class=
"text1" />
</form>
Does that look right?
|

02-19-2012, 06:31 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
|
|
|
Why are you using the same form for the search and the property?
<form action="http://www.for-rent-nerja.com/search.php" <-----
Anywho...
Like you did with the search.php, by changing all of the $_GET to $_SESSION, do the same thing for the code in the property.php
They should look identical.
Also, on a side note* - I think after you are done, you should implement this whole section as an include, so that you only have to change one file and not every single file.
|

02-19-2012, 06:41 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
Quote:
Originally Posted by an0n
Why are you using the same form for the search and the property?
<form action="http://www.for-rent-nerja.com/search.php" <-----
Anywho...
Like you did with the search.php, by changing all of the $_GET to $_SESSION, do the same thing for the code in the property.php
They should look identical.
Also, on a side note* - I think after you are done, you should implement this whole section as an include, so that you only have to change one file and not every single file.
|
Hang on, I've only changed the $_GET to $_SESSION on the property.php . I just tried changing them on the search.php page but then that page stopped holding the fields! So where I had 1 page holding the fields and 1 not, that code made me have 2 pages not. I'm taking one step forward and two back! haha
|

02-19-2012, 06:53 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
|
|
|
You do have session_start() on the top of the property.php file right?
You need to invoke it in order to access the variables on the property.php
|

02-19-2012, 06:55 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
Quote:
Originally Posted by an0n
You do have session_start() on the top of the property.php file right?
You need to invoke it in order to access the variables on the property.php
|
Yeah, I have
PHP Code:
<?php session_start(); if(isset($_SESSION['get'])) $_GET=array_merge($_GET,$_SESSION['get']); ?>
|

02-19-2012, 07:13 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
|
|
|
Firstly, backup any files you will edit.
You don't need the if(isset($_GET['submit'])) $_SESSION['get']=$_GET; in the search.php file.
Setting the session values as you did on page one of this thread is all you need.
You don't need to merge the session either on the property page. This overly complicates you from calling it. You would have to reference the array for the value, so you can remove the if(isset($_SESSION['get'])) $_GET=array_merge($_GET,$_SESSION['get']); in the property.php file.
You need to simplify things. It's generally as easy and simple as this.
In search.php
php:
session_start();
$_SESSION['TYPE'] = $_Get['TYPE'];
form:
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ($_SESSION['TYPE'] == '') ? ' selected="selected"' : ''; ?>>Any</option>
</select>
************************
In property.php
php:
session_start();
$TYPE = $_SESSION['TYPE'];
form:
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ($TYPE == '') ? ' selected="selected"' : ''; ?>>Any</option>
</select>
|

02-19-2012, 07:30 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
|
I've got the code live exactly as above and it's not even holding the values on the search page anymore :/
|

02-19-2012, 07:36 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
|
|
Quote:
Originally Posted by sstoney200
I've got the code live exactly as above and it's not even holding the values on the search page anymore :/
|
And you have removed that extra code I stated above to remove correct?
|

02-19-2012, 07:43 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
Yeah this is what I've now got on search.php :
PHP Code:
<?php session_start();
$_SESSION['TYPE'] = $_Get['TYPE'];
$_SESSION['DURATION'] = $_Get['DURATION'];
$_SESSION['AREA'] = $_Get['AREA'];
$_SESSION['REGION'] = $_Get['REGION'];
$_SESSION['BEDROOMS'] = $_Get['BEDROOMS'];
?>
PHP Code:
<form action="http://www.for-rent-nerja.com/search.php" method="get" name="search" id="search" style="background-color:#fcf5f8">
<span class="t_color3"><u><b>Property Search</b></u></span><br />
<br />
Property Ref:<br />
<input type="text" size="15" id="REF" name="REF" /><br />
Property Type:<br />
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ($_SESSION['TYPE'] == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="apartment"<?php echo ($_SESSION['TYPE'] == 'apartment') ? ' selected="selected"' : ''; ?>>Apartment</option>
<option value="villa"<?php echo ($_SESSION['TYPE'] == 'villa') ? ' selected="selected"' : ''; ?>>Villa</option>
<option value="townhouse"<?php echo ($_SESSION['TYPE'] == 'townhouse') ? ' selected="selected"' : ''; ?>>Townhouse</option>
</select>
<br />
Duration:<br />
<select id="DURATION" name="DURATION" style="width: 120px">
<option value="holiday"<?php echo ($_SESSION['DURATION'] == 'holiday') ? ' selected="selected"' : ''; ?>>Holiday</option>
<option value="long term"<?php echo ($_SESSION['DURATION'] == 'long term') ? ' selected="selected"' : ''; ?>>Long Term</option>
<option value="sale"<?php echo ($_SESSION['DURATION'] == 'sale') ? ' selected="selected"' : ''; ?>>Sale</option>
</select>
<br />
Town:<br />
<select id="AREA" name="AREA" style="width: 120px" onchange="onRegionChange()">
<option value="Nerja"<?php echo ($_SESSION['AREA'] == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
<option value="Torrox"<?php echo ($_SESSION['AREA'] == 'Torrox') ? ' selected="selected"' : ''; ?>>Torrox</option>
<option value="Frigiliana"<?php echo ($_SESSION['AREA'] == 'Frigiliana') ? ' selected="selected"' : ''; ?>>Frigiliana</option>
<option value="Maro"<?php echo ($_SESSION['AREA'] == 'Maro') ? ' selected="selected"' : ''; ?>>Maro</option>
</select>
<div id="allForms">Area:<br />
<select id="REGION" name="REGION" style="width: 120px">
<option value=""<?php echo ($_SESSION['REGION'] == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="Central"<?php echo ($_SESSION['REGION'] == 'Central') ? ' selected="selected"' : ''; ?>>Central</option>
<option value="Burriana"<?php echo ($_SESSION['REGION'] == 'Burriana') ? ' selected="selected"' : ''; ?>>Burriana</option>
<option value="Capistrano"<?php echo ($_SESSION['REGION'] == 'Capistrano') ? ' selected="selected"' : ''; ?>>Capistrano</option>
<option value="Torrecilla"<?php echo ($_SESSION['REGION'] == 'Torrecilla') ? ' selected="selected"' : ''; ?>>Torrecilla</option>
<option value="Punta Lara"<?php echo ($_SESSION['REGION'] == 'Punta Lara') ? ' selected="selected"' : ''; ?>>Punta Lara</option>
<option value="Parador"<?php echo ($_SESSION['REGION'] == 'Parador') ? ' selected="selected"' : ''; ?>>Parador</option>
<option value="Carabeo"<?php echo ($_SESSION['REGION'] == 'Carabeo') ? ' selected="selected"' : ''; ?>>Carabeo</option>
<option value="Las Minas"<?php echo ($_SESSION['REGION'] == 'Las Minas') ? ' selected="selected"' : ''; ?>>Las Minas</option>
<option value="La Noria"<?php echo ($_SESSION['REGION'] == 'La Noria') ? ' selected="selected"' : ''; ?>>La Noria</option>
<option value="Tamango Hill"<?php echo ($_SESSION['REGION'] == 'Tamango Hill') ? ' selected="selected"' : ''; ?>>Tamango Hill</option>
<option value="Countryside"<?php echo ($_SESSION['REGION'] == 'Countryside') ? ' selected="selected"' : ''; ?>>Countryside</option>
</select>
</div>
Bedrooms:<br />
<select id="BEDROOMS" name="BEDROOMS" style="width: 120px">
<option value="1 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '1 bedroom') ? ' selected="selected"' : ''; ?>>1</option>
<option value="2 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '2 bedroom') ? ' selected="selected"' : ''; ?>>2</option>
<option value="3 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '3 bedroom') ? ' selected="selected"' : ''; ?>>3</option>
<option value="4 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '4 bedroom') ? ' selected="selected"' : ''; ?>>4</option>
<option value="5 bedroom"<?php echo ($_SESSION['BEDROOMS'] == '5 bedroom') ? ' selected="selected"' : ''; ?>>5+</option>
</select>
<br />
<br />
<input name="submit" type="submit" class="text1" value=
"Submit" />
<input type="reset" name="Clear" value="Reset" class=
"text1" />
</form>
and this on property.php :
PHP Code:
<?php session_start();
$TYPE = $_SESSION['TYPE'];
$DURATION = $_SESSION['DURATION'];
$AREA = $_SESSION['AREA'];
$REGION = $_SESSION['REGION'];
$BEDROOMS = $_SESSION['BEDROOMS'];
?>
PHP Code:
<form action="http://www.for-rent-nerja.com/search.php" method="get" name="search" id="search" style="background-color:#fcf5f8">
<span class="t_color3"><u><b>Property Search</b></u></span><br />
<br />
Property Ref:<br />
<input type="text" size="15" id="REF" name="REF" /><br />
Property Type:<br />
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ('TYPE' == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="apartment"<?php echo ('TYPE' == 'Apartment') ? ' selected="selected"' : ''; ?>>Apartment</option>
<option value="villa"<?php echo ('TYPE' == 'Villa') ? ' selected="selected"' : ''; ?>>Villa</option>
<option value="townhouse"<?php echo ('TYPE' == 'Townhouse') ? ' selected="selected"' : ''; ?>>Townhouse</option>
</select>
<br />
Duration:<br />
<select id="DURATION" name="DURATION" style="width: 120px">
<option value="holiday"<?php echo ('DURATION' == 'holiday') ? ' selected="selected"' : ''; ?>>Holiday</option>
<option value="long term"<?php echo ('DURATION' == 'long term') ? ' selected="selected"' : ''; ?>>Long Term</option>
<option value="sale"<?php echo ('DURATION' == 'sale') ? ' selected="selected"' : ''; ?>>Sale</option>
</select>
<br />
Town:<br />
<select id="AREA" name="AREA" style="width: 120px" onchange="onRegionChange()">
<option value="Nerja"<?php echo ('AREA' == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
<option value="Torrox"<?php echo ('AREA' == 'Torrox') ? ' selected="selected"' : ''; ?>>Torrox</option>
<option value="Frigiliana"<?php echo ('AREA' == 'Frigiliana') ? ' selected="selected"' : ''; ?>>Frigiliana</option>
<option value="Maro"<?php echo ('AREA' == 'Maro') ? ' selected="selected"' : ''; ?>>Maro</option>
</select>
<div id="allForms">Area:<br />
<select id="REGION" name="REGION" style="width: 120px">
<option value=""<?php echo ('REGION' == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="Central"<?php echo ('REGION' == 'Central') ? ' selected="selected"' : ''; ?>>Central</option>
<option value="Burriana"<?php echo ('REGION' == 'Burriana') ? ' selected="selected"' : ''; ?>>Burriana</option>
<option value="Capistrano"<?php echo ('REGION' == 'Capistrano') ? ' selected="selected"' : ''; ?>>Capistrano</option>
<option value="Torrecilla"<?php echo ('REGION' == 'Torrecilla') ? ' selected="selected"' : ''; ?>>Torrecilla</option>
<option value="Punta Lara"<?php echo ('REGION' == 'Punta Lara') ? ' selected="selected"' : ''; ?>>Punta Lara</option>
<option value="Parador"<?php echo ('REGION' == 'Parador') ? ' selected="selected"' : ''; ?>>Parador</option>
<option value="Carabeo"<?php echo ('REGION' == 'Carabeo') ? ' selected="selected"' : ''; ?>>Carabeo</option>
<option value="Las Minas"<?php echo ('REGION' == 'Las Minas') ? ' selected="selected"' : ''; ?>>Las Minas</option>
<option value="La Noria"<?php echo ('REGION' == 'La Noria') ? ' selected="selected"' : ''; ?>>La Noria</option>
<option value="Tamango Hill"<?php echo ('REGION' == 'Tamango Hill') ? ' selected="selected"' : ''; ?>>Tamango Hill</option>
<option value="Countryside"<?php echo ('REGION' == 'Countryside') ? ' selected="selected"' : ''; ?>>Countryside</option>
</select>
</div>
Bedrooms:<br />
<select id="BEDROOMS" name="BEDROOMS" style="width: 120px">
<option value="1 bedroom"<?php echo ('BEDROOMS' == '1 bedroom') ? ' selected="selected"' : ''; ?>>1</option>
<option value="2 bedroom"<?php echo ('BEDROOMS' == '2 bedroom') ? ' selected="selected"' : ''; ?>>2</option>
<option value="3 bedroom"<?php echo ('BEDROOMS' == '3 bedroom') ? ' selected="selected"' : ''; ?>>3</option>
<option value="4 bedroom"<?php echo ('BEDROOMS' == '4 bedroom') ? ' selected="selected"' : ''; ?>>4</option>
<option value="5 bedroom"<?php echo ('BEDROOMS' == '5 bedroom') ? ' selected="selected"' : ''; ?>>5+</option>
</select>
<br />
<br />
<input name="submit" type="submit" class="text1" value=
"Submit" />
<input type="reset" name="Clear" value="Reset" class=
"text1" />
</form>
|

02-19-2012, 08:03 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
|
|
|
search
<?php session_start();
$_SESSION['TYPE'] = $_Get['TYPE'];
$_SESSION['DURATION'] = $_Get['DURATION'];
$_SESSION['AREA'] = $_Get['AREA'];
$_SESSION['REGION'] = $_Get['REGION'];
$_SESSION['BEDROOMS'] = $_Get['BEDROOMS'];
?>
$_GET ... change em to caps
************
property
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ('TYPE' == '') ? ' selected="selected"' : ''; ?>>Any</option>
$TYPE
Its a variable
That also goes for
DURATION
AREA
REGION
BEDROOMS
|

02-19-2012, 08:16 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
Quote:
Originally Posted by an0n
search
<?php session_start();
$_SESSION['TYPE'] = $_Get['TYPE'];
$_SESSION['DURATION'] = $_Get['DURATION'];
$_SESSION['AREA'] = $_Get['AREA'];
$_SESSION['REGION'] = $_Get['REGION'];
$_SESSION['BEDROOMS'] = $_Get['BEDROOMS'];
?>
$_GET ... change em to caps
************
property
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ('TYPE' == '') ? ' selected="selected"' : ''; ?>>Any</option>
$TYPE
Its a variable
That also goes for
DURATION
AREA
REGION
BEDROOMS
|
Thanks for your continued assistance dude!
Well spotted, it's now holding the values on search.php and I've edited the property.php like so:
PHP Code:
<form action="http://www.for-rent-nerja.com/search.php" method="get" name="search" id="search" style="background-color:#fcf5f8">
<span class="t_color3"><u><b>Property Search</b></u></span><br />
<br />
Property Ref:<br />
<input type="text" size="15" id="REF" name="REF" /><br />
Property Type:<br />
<select id="TYPE" name="TYPE" style="width: 120px">
<option value=""<?php echo ('$TYPE' == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="apartment"<?php echo ('$TYPE' == 'Apartment') ? ' selected="selected"' : ''; ?>>Apartment</option>
<option value="villa"<?php echo ('$TYPE' == 'Villa') ? ' selected="selected"' : ''; ?>>Villa</option>
<option value="townhouse"<?php echo ('$TYPE' == 'Townhouse') ? ' selected="selected"' : ''; ?>>Townhouse</option>
</select>
<br />
Duration:<br />
<select id="DURATION" name="DURATION" style="width: 120px">
<option value="holiday"<?php echo ('$DURATION' == 'holiday') ? ' selected="selected"' : ''; ?>>Holiday</option>
<option value="long term"<?php echo ('$DURATION' == 'long term') ? ' selected="selected"' : ''; ?>>Long Term</option>
<option value="sale"<?php echo ('$DURATION' == 'sale') ? ' selected="selected"' : ''; ?>>Sale</option>
</select>
<br />
Town:<br />
<select id="AREA" name="AREA" style="width: 120px" onchange="onRegionChange()">
<option value="Nerja"<?php echo ('$AREA' == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
<option value="Torrox"<?php echo ('$AREA' == 'Torrox') ? ' selected="selected"' : ''; ?>>Torrox</option>
<option value="Frigiliana"<?php echo ('$AREA' == 'Frigiliana') ? ' selected="selected"' : ''; ?>>Frigiliana</option>
<option value="Maro"<?php echo ('$AREA' == 'Maro') ? ' selected="selected"' : ''; ?>>Maro</option>
</select>
<div id="allForms">Area:<br />
<select id="REGION" name="REGION" style="width: 120px">
<option value=""<?php echo ('$REGION' == '') ? ' selected="selected"' : ''; ?>>Any</option>
<option value="Central"<?php echo ('$REGION' == 'Central') ? ' selected="selected"' : ''; ?>>Central</option>
<option value="Burriana"<?php echo ('$REGION' == 'Burriana') ? ' selected="selected"' : ''; ?>>Burriana</option>
<option value="Capistrano"<?php echo ('$REGION' == 'Capistrano') ? ' selected="selected"' : ''; ?>>Capistrano</option>
<option value="Torrecilla"<?php echo ('$REGION' == 'Torrecilla') ? ' selected="selected"' : ''; ?>>Torrecilla</option>
<option value="Punta Lara"<?php echo ('$REGION' == 'Punta Lara') ? ' selected="selected"' : ''; ?>>Punta Lara</option>
<option value="Parador"<?php echo ('$REGION' == 'Parador') ? ' selected="selected"' : ''; ?>>Parador</option>
<option value="Carabeo"<?php echo ('$REGION' == 'Carabeo') ? ' selected="selected"' : ''; ?>>Carabeo</option>
<option value="Las Minas"<?php echo ('$REGION' == 'Las Minas') ? ' selected="selected"' : ''; ?>>Las Minas</option>
<option value="La Noria"<?php echo ('$REGION' == 'La Noria') ? ' selected="selected"' : ''; ?>>La Noria</option>
<option value="Tamango Hill"<?php echo ('$REGION' == 'Tamango Hill') ? ' selected="selected"' : ''; ?>>Tamango Hill</option>
<option value="Countryside"<?php echo ('$REGION' == 'Countryside') ? ' selected="selected"' : ''; ?>>Countryside</option>
</select>
</div>
Bedrooms:<br />
<select id="BEDROOMS" name="BEDROOMS" style="width: 120px">
<option value="1 bedroom"<?php echo ('$BEDROOMS' == '1 bedroom') ? ' selected="selected"' : ''; ?>>1</option>
<option value="2 bedroom"<?php echo ('$BEDROOMS' == '2 bedroom') ? ' selected="selected"' : ''; ?>>2</option>
<option value="3 bedroom"<?php echo ('$BEDROOMS' == '3 bedroom') ? ' selected="selected"' : ''; ?>>3</option>
<option value="4 bedroom"<?php echo ('$BEDROOMS' == '4 bedroom') ? ' selected="selected"' : ''; ?>>4</option>
<option value="5 bedroom"<?php echo ('$BEDROOMS' == '5 bedroom') ? ' selected="selected"' : ''; ?>>5+</option>
</select>
<br />
<br />
<input name="submit" type="submit" class="text1" value=
"Submit" />
<input type="reset" name="Clear" value="Reset" class=
"text1" />
</form>
but it's still not sticking through!
|

02-19-2012, 09:04 AM
|
|
Banned
Latest Blog: None
|
|
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
|
|
|
They are variables. No need for single quotes around them.
Like this:
<option value="Nerja"<?php echo ($AREA == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
Not like what you have:
<option value="Nerja"<?php echo ('$AREA' == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
|

02-19-2012, 09:13 AM
|
 |
Super Moderator
|
|
Join Date: 02-10-07
Location: Central Kentucky
Posts: 10,080
|
|
|
I may be wrong but something about having two different forms post to the same script bothers me. It might be okay but then again it could be screwing your values. One would have to analyze all the calls on the pages to know for sure.
@ an0n you surely have jumped right back into a helping role. Duly noted.
|

02-19-2012, 09:16 AM
|
 |
Contributing Member
Latest Blog: None
|
|
Join Date: 12-03-10
Location: Essex, UK
Posts: 273
|
|
Quote:
Originally Posted by an0n
They are variables. No need for single quotes around them.
Like this:
<option value="Nerja"<?php echo ($AREA == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
Not like what you have:
<option value="Nerja"<?php echo ('$AREA' == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option>
|
Hmm well I've edited like so:
PHP Code:
<form action="http://www.for-rent-nerja.com/search.php" method="get" name="search" id="search" style="background-color:#fcf5f8"> <span class="t_color3"><u><b>Property Search</b></u></span><br /> <br /> Property Ref:<br /> <input type="text" size="15" id="REF" name="REF" /><br /> Property Type:<br /> <select id="TYPE" name="TYPE" style="width: 120px"> <option value=""<?php echo ($TYPE == '') ? ' selected="selected"' : ''; ?>>Any</option> <option value="apartment"<?php echo ($TYPE == 'Apartment') ? ' selected="selected"' : ''; ?>>Apartment</option> <option value="villa"<?php echo ($TYPE == 'Villa') ? ' selected="selected"' : ''; ?>>Villa</option> <option value="townhouse"<?php echo ($TYPE == 'Townhouse') ? ' selected="selected"' : ''; ?>>Townhouse</option> </select> <br /> Duration:<br /> <select id="DURATION" name="DURATION" style="width: 120px"> <option value="holiday"<?php echo ($DURATION == 'holiday') ? ' selected="selected"' : ''; ?>>Holiday</option> <option value="long term"<?php echo ($DURATION == 'long term') ? ' selected="selected"' : ''; ?>>Long Term</option> <option value="sale"<?php echo ($DURATION == 'sale') ? ' selected="selected"' : ''; ?>>Sale</option> </select> <br /> Town:<br /> <select id="AREA" name="AREA" style="width: 120px" onchange="onRegionChange()"> <option value="Nerja"<?php echo ($AREA == 'Nerja') ? ' selected="selected"' : ''; ?>>Nerja</option> <option value="Torrox"<?php echo ($AREA == 'Torrox') ? ' selected="selected"' : ''; ?>>Torrox</option> <option value="Frigiliana"<?php echo ($AREA == 'Frigiliana') ? ' selected="selected"' : ''; ?>>Frigiliana</option> <option value="Maro"<?php echo ($AREA == 'Maro') ? ' selected="selected"' : ''; ?>>Maro</option> </select> <div id="allForms">Area:<br /> <select id="REGION" name="REGION" style="width: 120px"> <option value=""<?php echo ($REGION == '') ? ' selected="selected"' : ''; ?>>Any</option> <option value="Central"<?php echo ($REGION == 'Central') ? ' selected="selected"' : ''; ?>>Central</option> <option value="Burriana"<?php echo ($REGION == 'Burriana') ? ' selected="selected"' : ''; ?>>Burriana</option> <option value="Capistrano"<?php echo ($REGION == 'Capistrano') ? ' selected="selected"' : ''; ?>>Capistrano</option> <option value="Torrecilla"<?php echo ($REGION == 'Torrecilla') ? ' selected="selected"' : ''; ?>>Torrecilla</option> <option value="Punta Lara"<?php echo ($REGION == 'Punta Lara') ? ' selected="selected"' : ''; ?>>Punta Lara</option> <option value="Parador"<?php echo ($REGION == 'Parador') ? ' selected="selected"' : ''; ?>>Parador</option> <option value="Carabeo"<?php echo ($REGION == 'Carabeo') ? ' selected="selected"' : ''; ?>>Carabeo</option> <option value="Las Minas"<?php echo ($REGION == 'Las Minas') ? ' selected="selected"' : ''; ?>>Las Minas</option> <option value="La Noria"<?php echo ($REGION == 'La Noria') ? ' selected="selected"' : ''; ?>>La Noria</option> <option value="Tamango Hill"<?php echo ($REGION == 'Tamango Hill') ? ' selected="selected"' : ''; ?>>Tamango Hill</option> <option value="Countryside"<?php echo ($REGION == 'Countryside') ? ' selected="selected"' : ''; ?>>Countryside</option> </select> </div> Bedrooms:<br /> <select id="BEDROOMS" name="BEDROOMS" style="width: 120px"> <option value="1 bedroom"<?php echo ($BEDROOMS == '1 bedroom') ? ' selected="selected"' : ''; ?>>1</option> <option value="2 bedroom"<?php echo ($BEDROOMS == '2 bedroom') ? ' selected="selected"' : ''; ?>>2</option> <option value="3 bedroom"<?php echo ($BEDROOMS == '3 bedroom') ? ' selected="selected"' : ''; ?>>3</option> <option value="4 bedroom"<?php echo ($BEDROOMS == '4 bedroom') ? ' selected="selected"' : ''; ?>>4</option> <option value="5 bedroom"<?php echo ($BEDROOMS == '5 bedroom') ? ' selected="selected"' : ''; ?>>5+</option> </select> <br /> <br /> <input name="submit" type="submit" class="text1" value= "Submit" /> <input type="reset" name="Clear" value="Reset" class= "text1" /> </form>
but still no joy! :/
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 02:27 PM.
Powered by vBulletin Copyright © 2000-2013 Jelsoft Enterprises Limited.
Copyright © 2003 - 2013 Escalate Media LP
|
|
|