Skip to main content
Participant
March 5, 2008
Question

Displaying Distinct User Profiles

  • March 5, 2008
  • 1 reply
  • 458 views
I am familiar with creating login and register pages for users to access restricted pages (i.e. Admin Area). In my database, I have a members table that consist of one person's profile info including a username and password fields. What I want to accomplish is that when one user logs in, that they will be directed to a profile.php page that will display only their information and not that of other users. How can I filter the profile.php page to display only that record of the person signing in? Do I need to pass some sort of variable from the login page to the profile.php page? If the user logs in correctly, how can he or she be restricted to view info of other members who's profile info is stored in the same members table?
This topic has been closed for replies.

1 reply

Inspiring
March 5, 2008
if you're using the DW login behavior, it creates a session var named
'MM_Username' containing, of course, the user name. so, in the DB query
in profile.php page you can filter to get the proper data

if you're using your own code, just create a var session when the login
is successful and before redirecting to profile.php

zuffster wrote:
> I am familiar with creating login and register pages for users to access
> restricted pages (i.e. Admin Area). In my database, I have a members table that
> consist of one person's profile info including a username and password fields.
> What I want to accomplish is that when one user logs in, that they will be
> directed to a profile.php page that will display only their information and not
> that of other users. How can I filter the profile.php page to display only that
> record of the person signing in? Do I need to pass some sort of variable from
> the login page to the profile.php page? If the user logs in correctly, how can
> he or she be restricted to view info of other members who's profile info is
> stored in the same members table?
>
zuffsterAuthor
Participant
March 5, 2008
Thanks JD! I will give that a shot. I am using the DW login behavior.