You can store the url of the secured page in a hidden input fied of login
form to redirect to the particular url after login.

For eg, if the page is products.php, when a visitors visits this display him
a login form and add an hidden form field with url "products.php". Modify
your login check mechanism so that if the login details are correct and
there is a value set for the hidden filed, it redirects to hidden filed
instead of homepage. If the hidden filed is blank, redirect to homepage.


Regards,
Gautam Chaudhary
http://gautamchaudhary.com



On Tue, Jun 21, 2011 at 3:42 AM, Aamir Khan <[email protected]> wrote:

>      I have a website with some pages and simple login mechanism.....some
> of the pages are private and some of them are public...If user wants to
> access private page, i want the user directed to login page with some
> additional parameters using which after logging of the user will proceed to
> the page he requested first...i mean i don't want to show the home page
> after user logged in but the page user requested first while he was not
> logged in..
>
>   To make it simple...if you give some message address of your gmail and
> you are not logged in then it redirects you to login page but after you log
> in it servers the page (message in this case) rather than showing you your
> inbox.
>
>   In many professional websites the behavior i explained is pretty much
> common and i want to know the best way to implement it.
>
> --
> Aamir Khan
> Indian Institute of Technology Roorkee,
> Roorkee, Uttarakhand,
> India , 247667
> Phone: +91 9557647357
> email:   [email protected]
>             [email protected]
>
>
>  --
> Mailing list guidelines and other related articles:
> http://lug-iitd.org/Footer
>

-- 
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer

Reply via email to