Session variables
| From: | Mike Yuen | Date: | Sat, 06 Jan 2001 00:20:21 +0000 |
| Subject: | Session variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-32982@lists.php.net to get a copy of this message | ||
I'm new to PHP and need a bit of help.
I'm not sure if this is the best of way of doing this but I have two
pages:
1. newmemberlogin.php - this is basically a form asking for information
about the user and saves it in sessions.
2. login.php - this logs the person in and greets them with their first
and last name.
What i'm stumped on is the following in pseudo-code:
if (session exists)
{
print "$firstname $lastname" //comes from session saved from
newmemberlogin.php
}
else
{
query = mysql_query (select * from clients where
username=username(from form)
print $firstname $lastname //prints name, data from database
save data from database into session
}
I have no idea how to query data and save it into a session.
Thanks,
Mike