gerkintrigg Posted May 14, 2007 Share Posted May 14, 2007 Hiya. I'm trying to work out how to go back to the search results page from an individual product page. I've tried to use the following code: if (isset($HTTP_REFERER)) { echo "<a href='$HTTP_REFERER' class='text'>Back to search results</a>"; } else { echo "<a href='javascript:history.back()' class='text'>Back to search results</a>"; } but the problem is that it just sends the user back to the last page, so isn't reliable enough. I have a product page which contains one or more images, each image requires the page to re-load, so I want to re-direct the user to the search page from any of these iterations. Could someone suggest how to do this? Is there a way of writing search variables into a session identifier that I can easily reference? I know of several ways to do it using if statements and writing lots more sessions but I'm sure there's a cleaner way... Quote Link to comment https://forums.phpfreaks.com/topic/51312-going-back-to-search-results/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.