i am developing a website and i have a problem.
when i enter a keyword in my search tab, it works fine and displays all the products matching with the keyword.
when i click on a single product the product page opens fine also. but i want all the remaining search queries which showed up earlier to display under the single product page. how can i do that?

Recommended Answers

All 3 Replies

You need to pass the original search query on to the product page, either with the URL or POST data depending on how you search for things currently. Once on the product page, use the original search term to re-run the query excluding the currently displayed item.

You can also save the original search query (or results) into the session ($_SESSION array) and use the values in the other script.

See http://www.php.net/manual/en/book.session.php

Use ajax and load the product details inside the result page using div(place an empty div on the top of the page while loading results) which pushes ur search items to the bottom. No extra querying or maintaining session.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.