dimanche 24 avril 2016

Returning to page from where redirect request is made

There are lot of relavent questions with many answets to this but i wanted to know what is the best and suggested method for this.

The question is simple.i wanted to redirect from one page to other when a condition is not met and after this condition became true in the redirected page,return to the same page from where the redirect is requested in a php or jsp page

More relavent example would be : when a user wants to buy a product from a website,when he chooses a product and want to make payment, the site checks whether the user has log in to the site. If not it takes to login page,and after logging in,take the user to the payment page directly rather than some homepage which usually the login page takes to.

There were options like storing sessions and storing the requested url in a session variable and then use this to return to the page.

But my question is to find what is the most suitable standard for this. Can someone tell what popular websites like amazon and flipkart are following to achieve this.

Detailed answers are appreciated. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire