mcmuney Posted September 5, 2006 Share Posted September 5, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/19734-redirection-after-login/ Share on other sites More sharing options...
mitzleah Posted September 5, 2006 Share Posted September 5, 2006 Hey,Use Location($_SERVER['HTTP_REFERER']);Also use condition when it will be directed to account page. Hope this one will help! :) Quote Link to comment https://forums.phpfreaks.com/topic/19734-redirection-after-login/#findComment-86170 Share on other sites More sharing options...
HuggieBear Posted September 5, 2006 Share Posted September 5, 2006 mcmuney,Did this help you at all?RegardsRich Quote Link to comment https://forums.phpfreaks.com/topic/19734-redirection-after-login/#findComment-86317 Share on other sites More sharing options...
mcmuney Posted September 5, 2006 Author Share Posted September 5, 2006 Not really, I think I need more clarification. Quote Link to comment https://forums.phpfreaks.com/topic/19734-redirection-after-login/#findComment-86722 Share on other sites More sharing options...
drkstr Posted September 6, 2006 Share Posted September 6, 2006 [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 Quote Link to comment https://forums.phpfreaks.com/topic/19734-redirection-after-login/#findComment-86833 Share on other sites More sharing options...
Moon-Man.net Posted September 6, 2006 Share Posted September 6, 2006 I have created a login system that uses 3 files.Login.html : The form with login detailsvalidate.php : The file that sets the session to logged or not loggedsecure.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 pageIf you read the files, you will have a better idea!Hope that helps!Cheers[attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/19734-redirection-after-login/#findComment-86891 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.