Return to the search results. (PHP)?

0 like 0 dislike
6 views
Don't want to reinvent the wheel, but really the solution didn't work. in the network. So until I write, I would like to ask japanesemade.


You have a database, say, cars. According to the search request, consisting of about 4-5 fields, we derive a list of results, then go to the 4th page in the search results. In the end in the URL we get something like this:

www.autosite.com/catalog/?page=4¶m1=21¶m2=...


On this page we find what we need, and move on viewing this object:

www.autosite.com/view/id10001/


On the preview page of this object, it is necessary to perform, such as sending requests using the form on this object. Ie to reload the page again.


Hence the question:

How to implement a more correct return to the search results, i.e. pulling yourself constantly in the URL string:

?page=4¶m1=21¶m2=33¶m3=13&...¶m44=123

Moreover, can constantly change the search parameters added-removed, and the preparation and pulling a these parameters are somehow not very convenient. So far the only option I see is writing a layer that will handle any incoming URL request and constantly pass it on. But somehow it's not very nice...
by | 6 views

7 Answers

0 like 0 dislike
cookies ||
session ||
output_add_rewrite_var()
by
0 like 0 dislike
Remember in the session settings so that they can be later retrieved by numeric key, and the key pulled by
get
\r
$_SESSION['search_history'] = array(
1 => "?page=4¶m1=21¶m2=33¶m3=13&...¶m44=123"
, 2 => "another search"
etc
)
\r
If you need to return to the search page, simply retrieved from an array by key value.
by
0 like 0 dislike
but if one were to record the search parameters in a cookie? and later process them
by
0 like 0 dislike
Session, cookie?
by
0 like 0 dislike
>Above unsubscribed that it is not suitable, since in the same session can be N number of search results
\r
Session IMHO the best option. and what hinders to store in session an array (hash) with the search results ?? or if not you need to keep a variable and with each change search query just grind it ???
by
0 like 0 dislike
1. to take "?page=4¶m1=21¶m2=33¶m3=13&...¶m44=123"
2. pass through a base64
3. to cram into a hidden field in the page
4. ...
5. Profit!
by
0 like 0 dislike
The only thing that came to mind in terms of separate tabs of a single browser's SessionStorage. But this is JS and his hands. And not all working yet.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
4 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
28,862 users