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
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*
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.