Jump to content

Archived

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

cheyner11

*Link back to search results*

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.

Share this post


Link to post
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*

Share this post


Link to post
Share on other sites
what would be contained in this search variable? Considering I have 10 possible fields..

Thanks.

Share this post


Link to post
Share on other sites

×

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.