Thread: php sessions
View Single Post
Old 10-09-2007, 11:21 AM   #9 (permalink)
Rating: 0% (0)
Almeria Property Place
Advancing Real Estate agent
 
Almeria Property Place's Avatar
 
Join Date: Jun 2007
Posts: 97
Send a message via Yahoo to Almeria Property Place Send a message via Skype™ to Almeria Property Place
Default

Quote:
Originally Posted by Matthew King View Post
Yes, you'd want something like this:

To add a property to portfolio:

e.g. /add.php?reference=1
Code:
    <?php
        session_start();
        $_SESSION['portfolio'] .= ',' . $_GET['reference'];
    ?>
Then to get the references back:

e.g. /portfolio.php

Code:
    <?php
        session_start();

        $references = explode(',' $_SESSION['portfolio']);

        foreach($references as $ref) {
            print($ref) . '<br />';
        }
    ?>
I haven't written any PHP properly for ages, so excuse me if there are any syntax errors there. Should give you a good starting point though.

Matthew
i only seem to get the comma in the quote marks storing in the session, how do i send the actual reference number to the session? i have tried the inserting the url link instead of the comma but it doesnt like it.
__________________
Jeremy Lister
Almeria Property Place
www.almeriapropertyplace.com
www.albaniapropertyplace.com
jlister@almeriapropertyplace.com
00 34 950 333 465
Almeria Property Place is offline   Reply With Quote
 

Spanish Real Estate Forum - Members newest adverts
CH5 New Villa Costa Azahar
A Castle in Spain
Costa Azahar Village House for sale
CHL Investment Opportunity Coasta Azahar
Cervera del Maestre Property