uri of previous page |
[eluser]dimis[/eluser]
I have a page for products of some producers and a add to cart function for these Code: glasses/productsupdatecart/$id Dimis
[eluser]GSV Sleeper Service[/eluser]
I'm using this method. Code: //open the form then in my Cart controller, index method I have this Code: // determine return path so, effectively when I post data to my Cart controller I'm posting to /cart/index/uri/of/page/i/want/to/return/to/
[eluser]sophistry[/eluser]
one drawback of the form action technique is the redirect target appears in the address bar and can be manipulated easily. if you don't mind using cookies, you could store the uri_string in a session. less code, redirect target can be encrypted. Code: // in one controller method
[eluser]barbazul[/eluser]
flash data could also work http://ellislab.com/codeigniter/user-gui...sions.html
[eluser]drewbee[/eluser]
Agreed. Flash data is my prefered way of doing this, or even regular session data.
[eluser]GSV Sleeper Service[/eluser]
why do I always have to complicate things?! I spent a good two minutes writing that code above. I should have just stuffed the referrer into the session. |
Welcome Guest, Not a member yet? Register Sign In |