Jump to content

*Link back to search results*


cheyner11

Recommended Posts

I am building a search engine for a site. A user can search by entering data in 10 different fields. Once a user gets results and clicks on a specific record (directed to record), how can I store this data so that I can let them click a link and go back to the search results?

I am using sessions.

The easiest way would be most appreciated.

Thanks.
Link to comment
https://forums.phpfreaks.com/topic/3809-link-back-to-search-results/
Share on other sites

just set a session variable called lastsearch that when a user searches for somthing it sets it.. Then on each page it has a link "original search" and has the prv search in a url e.g.

[a href=\"http://www.myurl.com/search.php?search=$lastsearch\" target=\"_blank\"]http://www.myurl.com/search.php?search=$lastsearch[/a]

and then on the search page before it validates all other searches just use

if (isset($_GET['search'])) {
//query and all that
} else {
//all other searchs from a POST
}

Is that a feisable idea?

*justa ruff guess at what your wanting*

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.