Jump to content

Archived

This topic is now archived and is closed to further replies.

mcmuney

Redirection after login

Recommended Posts

I have my pages setup so that when session="" it takes the visitor to a login page. After login, it takes the user to their account page. The problem is that when users attempt to see a certain page and they are not signed on, it will let them login, but then it takes them to their account page, rather then to the page they were trying to view. Is there an easy way to achieve this where if they login directly, it goes to their account page, but if they are directed to the login page because signon is required for that page they were trying to view, it takes them to that page after login??? THanks

Share this post


Link to post
Share on other sites
Hey,

Use

Location($_SERVER['HTTP_REFERER']);

Also use condition when it will be directed to account page. Hope this one will help! :)

Share this post


Link to post
Share on other sites
[quote author=mcmuney link=topic=106911.msg428788#msg428788 date=1157493578]
Not really, I think I need more clarification.
[/quote]
$_SERVER['HTTP_REFERER'] contains the page (string) the person was directed from. You should check that this page is part of your site and direct to it, otherwise, direct to the default page.

...drkstr

Share this post


Link to post
Share on other sites
I have created a login system that uses 3 files.
Login.html : The form with login details
validate.php : The file that sets the session to logged or not logged
secure.php : the file that denys or allows users access, if its denied, then include(login.html) then exit. Then the if they do login, just refresh the page

If you read the files, you will have a better idea!
Hope that helps!
Cheers

[attachment deleted by admin]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.