Re: session - help
| From: | Jeremy Weir | Date: | Thu, 17 Apr 2003 07:34:24 +0000 |
| Subject: | Re: session - help | ||
| References: | 1 2 | Groups: | php.general php.windows |
| Request: | Send a blank email to php-windows+get-19490@lists.php.net to get a copy of this message | ||
You have to call session_start() to initialize a session. Make sure you do
it outside of a function.
read this page: http://www.php.net/manual/en/ref.session.php
"Saravana Kumar S P" <sps@gulfmd.com> wrote in message
news:003801c304b1$3159b130$4bd1a4d9@yaltaserver...
Hi,
Am just a beginner to PHP, jumping from ASP. I tried re-coding from my small
ASP site. And the things worked fine until I met the login page. I store the
user data in sessions and access then.
The logging name, mail-id, userID are stored in session vars. I used this
<?php
$_SESSION ["MemberName"] = "Whatever";
$_SESSION ["MemberId"] = "Whatever";
$_SESSION ["MemberMail"] = "Whatever";
?>
to store the data on successful login attempt. The page redirects to home
page after that. When I try to access the session var there... it gives a
notice saying... the session variable is not defined?? How can I avoid that.
I didnt do with session_start () or things like that... as we dont do that
for in ASP.
Thanks,
SPS