Hello. Im new at php. Im have to take over a webpage project written in PHP by other person so im still studing the code (so hard to read other persons code). The webpage has a search engine of products. After searching there is a list of found products. Now if i click on the product i can see it and there are two buttons to browse trough the found products - "next product" and "previous product". I would allso like to add a button called "back" and when i click on it, it would go back to the search result page.
So how can i programm the php to memorise the search result page and use it as shortcut later. I allready managed to add the "back" button. Right now when i click on it, ofcourse nothing happens. Please help.
How to memorise page history and use it later
Moderator: General Moderators
Re: How to memorise page history and use it later
Use session variables to save the arguments that are posted when the client uses the search form to access the results page. When the client returns to the results page using the back link, use $_SESSION instead of $_POST to build the query for the database.
You could use sessions to cache the entire result set, but that's probably not the best solution if there is a lot of data to be cached.
PHP Manual: Session Handling
Edit: This post was recovered from search engine cache.
You could use sessions to cache the entire result set, but that's probably not the best solution if there is a lot of data to be cached.
PHP Manual: Session Handling
Edit: This post was recovered from search engine cache.