Member page redirect

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
brentc73
Forum Newbie
Posts: 4
Joined: Fri May 05, 2006 12:00 pm

Member page redirect

Post by brentc73 »

I need help!

I searched the forum and could not find anything.

I have created a MYSQL database and a php login page (IIS 5.0 webserver). In the database I have created unique usernames w/password and basically what I want is when User1 logins in he is taken to his own directory or page, when User2 logins in he is taken to his own directory or page, etc... This is where I am stuck, right now when Users log in they are taken to the same page as other users.

Any help would be appreciated.
User avatar
psurrena
Forum Contributor
Posts: 355
Joined: Thu Nov 10, 2005 12:31 pm
Location: Broolyn, NY

Post by psurrena »

Is this what you need?

Code: Select all

header('Location: nextpage.php');
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

'Their page' shouldn't be (unless you're doing something out of the ordinary) an actual separate page.

You set up one page as your "template" and fill in values pertaining to that user. Perhaps by identifying them in the session.

An example page:

Code: Select all

//  user 'bob' logs in
$name = $_SESSION['name'];

echo 'Hi, '.$name.'.  Welcome back!';

//  Would print Hi, bob.  Welcome back!

Another

Code: Select all

//  user 'sue' logs in
$name = $_SESSION['name'];

echo 'Hi, '.$name.'.  Welcome back!';

//  Would print Hi, sue.  Welcome back!
As you can see, the code is exactly the same, but will fill out the page differently for each user.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
brentc73
Forum Newbie
Posts: 4
Joined: Fri May 05, 2006 12:00 pm

good but...

Post by brentc73 »

Thanks for the inof but basically what I want to assign a link that only user that is logged in can see.

Example:

Bob logs in and he sees a link to bob.php

Sue logs in and she sees a link to sue.php

How would I go about this?
Post Reply