Re: regarding session
| From: | Graeme McLaren | Date: | Mon, 16 Sep 2002 17:54:45 +0000 |
| Subject: | Re: regarding session | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21786@lists.php.net to get a copy of this message | ||
Smita, you would put something like this in the start of your login
validation page:
session_start(); // This starts the session
$ValidUserID = $UserID; // UserID is the field in your database table,
here you're assigning it to $ValidUserID
session_register("ValidUserID"); // This function registers the session.
On each page thereafter you would use the session_start(); function and then
test to see if a valid session has been created by doing something like:
if(!session_register("ValidUserID"))
{
echo "Error msg here";
}
else
{
echo "This is stuff you see if you are logged in";
}
I'm new to all this also, but I've got it working so you shouldn't really
have many problems getting sessions to work.
Hope this helps you out.
Graeme :)
----- Original Message -----
From: "Smita Manohar" <smitamanohar@hotmail.com>
To: <php-db@lists.php.net>
Sent: Monday, September 16, 2002 6:13 PM
Subject: [PHP-DB] regarding session
>
> Hi all...
> im new to php. but thnx to this list as im getting lot of help from this.
> now again stuck with one problem and want help from u ppl.
>
> i want to provide login name and password for the members of my site.
hence
> login and logout stuff is obvious. i know i must use sessions for this. i
> saw many functions for sessions in php manual. but getting counfused how
to
> proceed.
>
> want detail info regarding sessions.
> thanks in advance
>
> smita.
>
>
>
> _________________________________________________________________
> Chat with friends online, try MSN Messenger:
> http://messenger.msn.com
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>