Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

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


Reply
 
LinkBack Thread Tools Display Modes
Share |
  #21 (permalink)  
Old 02-17-2012, 04:35 PM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 11,813
iTrader: 4 / 100%
No I think you may be green but right. Does that make sense?
__________________
SEO does not mean Spam Everywhere Online
Scriptman's Playhouse || Ramblings from an old man
 
Reply With Quote
  #22 (permalink)  
Old 02-18-2012, 02:21 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
Quote:
Originally Posted by ScriptMan View Post
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.
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #23 (permalink)  
Old 02-18-2012, 02:25 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
Quote:
Originally Posted by an0n View Post
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
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #24 (permalink)  
Old 02-19-2012, 05:56 AM
Banned
Latest Blog:
None

 
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
iTrader: 0 / 0%
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.
 
Reply With Quote
  #25 (permalink)  
Old 02-19-2012, 06:00 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
Quote:
Originally Posted by an0n View Post
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?
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #26 (permalink)  
Old 02-19-2012, 06:08 AM
Banned
Latest Blog:
None

 
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
iTrader: 0 / 0%
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?
 
Reply With Quote
  #27 (permalink)  
Old 02-19-2012, 06:25 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
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?
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #28 (permalink)  
Old 02-19-2012, 06:31 AM
Banned
Latest Blog:
None

 
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
iTrader: 0 / 0%
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.
 
Reply With Quote
  #29 (permalink)  
Old 02-19-2012, 06:41 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
Quote:
Originally Posted by an0n View Post
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
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #30 (permalink)  
Old 02-19-2012, 06:53 AM
Banned
Latest Blog:
None

 
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
iTrader: 0 / 0%
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
 
Reply With Quote
  #31 (permalink)  
Old 02-19-2012, 06:55 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
Quote:
Originally Posted by an0n View Post
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']); ?>
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #32 (permalink)  
Old 02-19-2012, 07:13 AM
Banned
Latest Blog:
None

 
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
iTrader: 0 / 0%
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>
 
Reply With Quote
  #33 (permalink)  
Old 02-19-2012, 07:30 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
I've got the code live exactly as above and it's not even holding the values on the search page anymore :/
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #34 (permalink)  
Old 02-19-2012, 07:36 AM
Banned
Latest Blog:
None

 
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
iTrader: 0 / 0%
Quote:
Originally Posted by sstoney200 View Post
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?
 
Reply With Quote
  #35 (permalink)  
Old 02-19-2012, 07:43 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
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>
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #36 (permalink)  
Old 02-19-2012, 08:03 AM
Banned
Latest Blog:
None

 
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
iTrader: 0 / 0%
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
 
Reply With Quote
  #37 (permalink)  
Old 02-19-2012, 08:16 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
Quote:
Originally Posted by an0n View Post
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!
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
  #38 (permalink)  
Old 02-19-2012, 09:04 AM
Banned
Latest Blog:
None

 
Join Date: 05-01-06
Location: I live in the real world!
Posts: 329
iTrader: 0 / 0%
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>
 
Reply With Quote
  #39 (permalink)  
Old 02-19-2012, 09:13 AM
ScriptMan's Avatar
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 11,813
iTrader: 4 / 100%
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.
__________________
SEO does not mean Spam Everywhere Online
Scriptman's Playhouse || Ramblings from an old man
 
Reply With Quote
  #40 (permalink)  
Old 02-19-2012, 09:16 AM
sstoney200's Avatar
Contributing Member
Latest Blog:
None

 
Join Date: 12-03-10
Location: Essex, UK
Posts: 276
iTrader: 0 / 0%
Quote:
Originally Posted by an0n View Post
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! :/
__________________
for-rent-nerja.com Rent Apartments in Nerja, Spain!
Website Designers Essex Website Designers and Company Branding in Essex and London, UK!
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
session_start(); only works once? curtisjwinton Coding Forum 1 10-24-2009 02:57 AM
Warning: session_start(): rarca Coding Forum 3 01-19-2009 10:39 AM


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 10:54 PM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2014 Escalate Media




Search Engine Optimization by vBSEO 3.6.0 RC 2 ©2011, Crawlability, Inc.