Jump to content

Redirection after login


mcmuney

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
Link to comment
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
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.