Welcome Guest, Not a member yet? Register   Sign In
Storing previous URL as session data
#1

[eluser]crikey[/eluser]
Hi guys,

Apologies in advance if this has already been covered - but I couldn't find any info about this.

My scenario:

I have a delete function which can be executed from a URL with parameter (eg. mysite.com/thing/delete/1 - where '1' is the id of the item to be deleted). That's cool.

But the delete function can also be called from various other URLs where the ids of the items to be deleted are in a POST variable (from checkboxes). In this case, I use form validation to make sure at least one item has been selected, and if validation fails I need to return to the page that the user was on - it might be a search results page, a page which lists the latest 'things' etc, and show the validation error.

I'm just not sure how to determine what page the user was on to redirect them if validation fails.

I'd like to be able to store the previous URL as a session variable - but not too sure how to do it. If it helps, I'm using a DB to store session data.

Any help greatly appreciated.

Thanks,
Grant


Messages In This Thread
Storing previous URL as session data - by El Forum - 04-13-2010, 01:36 AM
Storing previous URL as session data - by El Forum - 04-13-2010, 01:50 AM
Storing previous URL as session data - by El Forum - 04-13-2010, 02:33 AM
Storing previous URL as session data - by El Forum - 04-13-2010, 02:39 AM
Storing previous URL as session data - by El Forum - 04-13-2010, 03:51 AM
Storing previous URL as session data - by El Forum - 04-13-2010, 05:30 AM
Storing previous URL as session data - by El Forum - 04-13-2010, 02:18 PM
Storing previous URL as session data - by El Forum - 04-13-2010, 02:35 PM
Storing previous URL as session data - by El Forum - 04-13-2010, 03:17 PM
Storing previous URL as session data - by El Forum - 04-13-2010, 08:50 PM
Storing previous URL as session data - by El Forum - 04-13-2010, 11:12 PM
Storing previous URL as session data - by El Forum - 04-14-2010, 03:19 AM
Storing previous URL as session data - by El Forum - 04-14-2010, 08:31 AM
Storing previous URL as session data - by El Forum - 04-14-2010, 08:59 AM
Storing previous URL as session data - by El Forum - 04-14-2010, 09:12 AM
Storing previous URL as session data - by El Forum - 04-14-2010, 09:38 AM
Storing previous URL as session data - by El Forum - 04-14-2010, 09:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB