What's the best approach to pass variables from one page to another if I don't want to alter a nice link? I'm using Zend Framework routers in php.
Lets say I have a list page with
<a href='/nice-link1/'>link1</a>
<a href='/nice-link2/'>link2</a>
<a href='/nice-link3/'>link3</a>
But I need to pass a status parameter e.g.(?previous_search=dog). I dont't want to expose to crawlers and users an url which is different than this:
<a href='/nice-link1/'>link1</a>
as users may share the link. But at the same time i need the previous_search variable in the /nice-link1/ page. I'd like to avoid session variables too. I was thinking to jquery but I'm not sure.
Thanks!
Personally I'd use Zend_Session_Namespace to store variables and keep them away from the URL.
Save your data as a cookie. http://www.quirksmode.org/js/cookies.html
Save your data via local storage. http://diveintohtml5.info/storage.html
Have your link actually be a form submit using POST so that variables aren't surfaced to the URL string. http://www.w3.org/TR/html401/interact/forms.html#h-17.13.1
In your instance, I'd recommend the cookie route. It's perfect for saving the user-specific data you'd like to respond to on your page, like previous searches.