Jump to content


Photo

*Link back to search results*


  • Please log in to reply
2 replies to this topic

#1 cheyner11

cheyner11
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationCalgary, Alberta, Canada

Posted 01 March 2006 - 07:35 AM

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.

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 01 March 2006 - 01:03 PM

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*
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 cheyner11

cheyner11
  • Members
  • PipPip
  • Member
  • 10 posts
  • LocationCalgary, Alberta, Canada

Posted 01 March 2006 - 08:09 PM

what would be contained in this search variable? Considering I have 10 possible fields..

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users