RE: Help with Sessions - Should be easy =]
| From: | Tim Ward | Date: | Fri, 21 Dec 2001 10:32:05 +0000 |
| Subject: | RE: Help with Sessions - Should be easy =] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-78440@lists.php.net to get a copy of this message | ||
session_register("sessionvar");
you can now assign values to $sessionvar (or whatever you've chosen to call
it). You need to register each variable and start the session at the top of
each script.
In practice it's a lot easier if you hold all your session stuff under a
single hash array, that way you only need to do 1 session_register and you
don't have to worry about post/get variable names clashing with session
variables.
If this doesn't work look at your track_vars and register_globals settings.
See http://www.php.net/manual/en/ref.session.php
<http://www.php.net/manual/en/ref.session.php>
.
Tim Ward
www.chessish.com <http://www.chessish.com>
----------
From: Tomasz Jachimczak [SMTP:tomasz@planetunreal.com]
Sent: 20 December 2001 14:53
To: php-general@lists.php.net
Subject: Help with Sessions - Should be easy =]
I am coming from an asp background, and am used to setting session
variables
very easily, but I cannot work them out here with all the different
commands.
I would like to store in a session variable output from a mysql db
(Got the
db bit working fine) but cannot for the life of me store or retrieve
anything from a session variable.
(more information if required)
I am retreiving user information from a database after verification,
and
would like to place certain feilds into a session variable for easy
access/retreival. I can get the information out of the database, but
cannot
place it into any sort of variable that will store on the page.
I have the latest official PHP, running with IIS on a Windows 2K
server with
IIS.
More questions to follow no doubt,
Thanks in advance,
- Tomasz