Forums

PHP

This topic is locked

Session variable question

Posted 04 Dec 2006 19:06:44
1
has voted
04 Dec 2006 19:06:44 Andy T posted:
I'm using DWMX/PHP/MySQL

1. Trying to personalize an access-restricted page

2. Members use email address as username on login page (heritage of registration page, which asks them for username in the form of email address)

3. Login page checks database table_members for access permissions

4. table_members contains fields: userID, firstName, lastName, username (email addy), pwd, yada yada yada

5. On restricted page, members see "Welcome [username]" (from{Session.MM_Username}), which looks kooky

Q: How to get "Welcome [firstName]" instead of [username]? Is there a form or session variable I can assign to the login form that will fix this?

Thanks in advance,

Andy

Replies

Replied 05 Dec 2006 19:04:45
05 Dec 2006 19:04:45 Alan C replied:

when you check the usename in the database you could pick up the first name, last name etc and put them into either the session or an object then use them later
Replied 12 Dec 2006 13:50:36
12 Dec 2006 13:50:36 Roddy Dairion replied:
Yes u can do it by using the idea Alan C gave you, but make sure that when this session expires, to redirect the user to the login page again.

Reply to this topic