[thelist] My Query string not getting results in pages

Steve Lewis slewis at macrovista.net
Mon Nov 18 15:39:01 CST 2002


J Paul Armstrong wrote:
> I have a query string that selects based on the search the user does; which
> works. When I've implemented the page/limit results, when you click on any
> of the page numbers, the query string stops working. Here is the query ...

Consider changing the way your paging works. I used 'barn' as my search
string for all fields. When I click on '10' results per page it uses the
url of (watch wrap, and I converted %20s to spaces):

http://www.mercantilelibrary.com/catalog/resulttest.php?query=select *
from book_catalog where last like '%barn%' or first like '%barn%' or
title like '%barn%' or genre like '%barn%' order by last&pageno=0&limit=10

It seems to me to be a very bad idea to pass a query in the url.  For
example: if you execute a query that was passed in the url, there is
nothing to keep me from changing this url to (watch wrap, and I
converted %20s to spaces)
http://www.mercantilelibrary.com/catalog/resulttest.php?query=drop
book_catalog ...and you probably don't want me doing that.


My recommendation would be to change the selection method for results
per page to be a <select> object from those links.  This should allow
you to give users the option of selecting a number of results in
searchtest.php as well as in resulttest.php and searchterm searchtype
and searchlimit will all be easily available to you.

--Steve




More information about the thelist mailing list