|
12-16-2004, 08:28 AM | #1 |
Green Mole
Join Date: Dec 2003
Posts: 5
|
How to reset paging after new search
When I go to the search page, enter a search term with many results, go to the second page, then enter a new search term with only very few results (that would show on one page only) I get an empty page showing results "21 - 1" and a back button. I.e. the limit is not reset after the new search. Strangely enough, the search form does not contain limit information and there is no get variable attached to the URL. I have a customized search page that stores GET variables as session vars. Is that where the script "remembers" the paging info?
Thanks for any insights on that. Bernd |
12-16-2004, 10:04 AM | #2 |
Head Mole
Join Date: May 2003
Posts: 2,539
|
Are you able to reproduce this on the online demo? I tried the online demo like this: a) search for phpdig b) click next c) search for hamlet but I didn't see anything peculiar.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension. |
12-16-2004, 10:22 AM | #3 |
Green Mole
Join Date: Dec 2003
Posts: 5
|
Salut Charter,
thanks for the speedy response (again!). As I thought the problem was that we use a script that turns GET variables to session variables, so $lim_start is already set to the value from the last search result display. In order to resolve this, I changed in search_functions.php the following line: if (isset($limit_start)) { $limit_start = $limite * floor($limit_start / $limite); } to: if (isset($_GET['lim_start'])) { $limit_start = $limite * floor($_GET['lim_start'] / $limite); } else { $limite=0; $lim_start=0; $limit_start=0; } Now I'm not sure whether this makes sense in all scenarios, but it works here. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
reset statistik | heike | How-to Forum | 2 | 02-17-2005 08:50 AM |