Hi,
I am well on my way with creating a modx site that shows results of an event database.
I have working categories and a search form,
Now I would like to keep the variables of the search form in the $_session variables.
that way, when browsing throug category A with certain search settings (ex country of the event), they will be remembered even if you go to another category.
So what I need to do is :
1 set the country variable from my form in the current session when submitting the form.
2 get the country variable from the current session.
I am thinking that shouldn't be too difficult but I can't seem to get started,
as I never worked with sessions before, any help would be great.
djemmers
www.tornooi.net online database for (sport) events in dutch.
To be redesigned, rewritten to modx with multiple languages...
ANY help appreciated, I cannot offer money but I can offer free advertising on the site. just message me.
-
☆ A M B ☆
- 3,141 Posts
To set it..
$_SESSION['searchdata'] = $arrayOfValues;
And to get it..
$arrayOfValues = $_SESSION['searchdata'];
MODX will then take care of storing the session and retrieving it again based on the PHPSESSID cookie.
Quote from: markh at Dec 16, 2012, 07:19 AMTo set it..
$_SESSION['searchdata'] = $arrayOfValues;
And to get it..
$arrayOfValues = $_SESSION['searchdata'];
MODX will then take care of storing the session and retrieving it again based on the PHPSESSID cookie. 
that's great, and it looks easy!
tnx
www.tornooi.net online database for (sport) events in dutch.
To be redesigned, rewritten to modx with multiple languages...
ANY help appreciated, I cannot offer money but I can offer free advertising on the site. just message me.