Page 1 of 1

Individual Redirect on login

Posted: Tue Feb 18, 2003 5:22 am
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

Posted: Tue Feb 18, 2003 5:50 am
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

Posted: Tue Feb 18, 2003 7:37 am
by thesponz
Guess it's just understanding the header command a bit more.

Think i need to read some more :o)

thanks anyway.

D