Bringing up user data specifically depending on username.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chrchcol
Forum Newbie
Posts: 15
Joined: Fri Jul 14, 2006 5:35 am

Bringing up user data specifically depending on username.

Post by chrchcol »

At the end of a validation page if the username is admin it redirects to another page.

If the username is anything else I want it to bring up a user page that is specific to a paticular username.

Is this easy to call from a database as long as the username is the the primary key?

Any ideas on the best way to code it?

Chris
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

Code: Select all

if ($is_admin == TRUE)
{
    // Redirect to admin page
}

// Otherwise print the user page
Also, I don't see why the username needs to be a primary key.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I would receommend using the user id, not username. And it is easy to do.
Post Reply