login and redirect
Moderator: General Moderators
login and redirect
hello! can someone help me.. can you give me an idea.. I want to make a login page and redirects it to different web page depending on the username and password used in logging in... thanks!
Re: login and redirect
Retrieve username and password from database authenticate it create session and then redirect it to desired page using function.
Code: Select all
headerRe: login and redirect
thanks Naeem.. I actually have the code already.. but for a single username and password only and it also redirects to a certain page.. but I need several usernames and passwords for example:
username: uname1
password:pass1
redirect to :www.subdomain1.domain.com
username: uname2
password:pass2
redirect to :www.subdomain2.domain.com
username: uname3
password:pass3
redirect to :www.subdomain3.domain.com
thanks!
username: uname1
password:pass1
redirect to :www.subdomain1.domain.com
username: uname2
password:pass2
redirect to :www.subdomain2.domain.com
username: uname3
password:pass3
redirect to :www.subdomain3.domain.com
thanks!
Re: login and redirect
Then i thing you have to apply conditions for each user
like if username = this then redirect it to this page.....
Or add a one more field in database like domain name and automatically assing a domain to each user when registering
Hope this help and sorry for late reply:)
like if username = this then redirect it to this page.....
Or add a one more field in database like domain name and automatically assing a domain to each user when registering
Hope this help and sorry for late reply:)
Re: login and redirect
thanks! but I don't have a database.. I'm thinking of using .htaccess
but can I use several .htpasswd.. like if this uname and pass deny all and allow this subdomain (eg)
if matched uname1 and password1 from .htpasswd
deny all and allow subdomain1.domain.com
if matched uname2 and password2 from .htpasswd
deny all and allow subdomain2.domain.com
ans so on
do you have an idea with this? thanks again
Code: Select all
AuthUserFile .htpasswd
AuthName ByPassword
AuthType Basic
order deny, allow
deny from all
allow from .subdomain.domain.com
require valid-user
if matched uname1 and password1 from .htpasswd
deny all and allow subdomain1.domain.com
if matched uname2 and password2 from .htpasswd
deny all and allow subdomain2.domain.com
ans so on
do you have an idea with this? thanks again