PDA

View Full Version : How to Redirect User to their Previous Page


hbibizadeh396670
10-15-2010, 02:01 PM
I have built a Comment System and after the user posts they are directed to a successful post page.

Although the system works fine, I need to use cookie toolkit to redirect the user back to whatever page they were previously on.

If you wanna see the system:
http://ashperfectimage.com/CommentScript/index.php#post


This is a problem because there are comment forms on a variety of different pages and they all post to the same page.

Thanks in advance

Ray Borduin
10-15-2010, 02:06 PM
Set a session variable with the page name of the current page on each of the pages you might want to redirect back to.

Then use that session variable as the redirect page.

hbibizadeh396670
10-15-2010, 03:21 PM
Thanks for the reply.

But I dont really understand.

Could you make it a bit simpler

Thanks

Ray Borduin
10-16-2010, 05:11 AM
Use the server behavior "Set Session Value" on each page that links into the form. Set the same session variable name with the value corresponding to the page name you are on.

Then in the redirect, use that session variable... I'm not sure I can explain it any simpler. Where are you getting stuck? Can you point out what part of my explanation you don't understand?