Individual Redirect on login

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
thesponz
Forum Newbie
Posts: 3
Joined: Wed Feb 12, 2003 3:51 pm

Individual Redirect on login

Post by thesponz »

OK guys, i've asked this one before and had no response, i am not being lazy and am still trying to research how to do this, but any additional help as i'm a novice would be appreciated.

I need a login script that checks the users input against values in a SQL database but instead of redirecting to a generic page when the values match i want to redirect the user to an individual url also stored against their login details in the SQL table.

For expample...
Username=Steve Password=123 URL=www.poo.com
Username=Dave Password=321 URL=www.wee.com

Each user would go to the page associated with their login details.

Thanks, D
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

You just need to get that URL from the database when you authenticate the user and then just make the redirect part dynamic by taking a variable instead of a hardcoded URL. For example you could do something like:

Code: Select all

header('Location: '.$from_database['URL']);
header(): http://www.php.net/manual/en/function.header.php

Mac
thesponz
Forum Newbie
Posts: 3
Joined: Wed Feb 12, 2003 3:51 pm

Post by thesponz »

Guess it's just understanding the header command a bit more.

Think i need to read some more :o)

thanks anyway.

D
Post Reply