PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Troubleshooting

Reply
 
Thread Tools
Old 12-16-2004, 08:28 AM   #1
salzbermat
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
salzbermat is offline   Reply With Quote
Old 12-16-2004, 10:04 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
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.
Charter is offline   Reply With Quote
Old 12-16-2004, 10:22 AM   #3
salzbermat
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.
salzbermat is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
reset statistik heike How-to Forum 2 02-17-2005 08:50 AM


All times are GMT -8. The time now is 04:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.