[thelist] My Query string not getting results in pages

Jason Bauer jbauer at chimesnet.com
Mon Nov 18 15:26:01 CST 2002


> ----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of J Paul Armstrong
> Sent: Monday, November 18, 2002 4:09 PM
> To: thelist at lists.evolt.org
> Subject: [thelist] My Query string not getting results in pages
>
> All the results come up fine, based on the code provided, the first time
you
> search and get results. But when you click on any of the page numbers, the
> query seems not to work anymore - where the keyword field is blank, it
> doesn't seem to understand that anymore (where it does the first time you
> search). I get errors. Here's the link to try it out ...

> http://www.mercantilelibrary.com/catalog/searchtest.php

The problem is that the link to the "Next Page" isn't sending the same data
as the original search form.

Your original search form is sending a $searchtype and a $searchterm. But,
if you'll look at the link after you click on the Next Page, it isn't
sending either of those values, only a query.

Based on the snippet of code you gave, your else clause is overwriting the
query sent from the page. So, instead of simply an else in that statement,
do an:

elseif($searchterm)
{
   $query = "blahblah";
}

This will only overwrite the $query if a search term is specified from your
original search form. This should let the query sent by the "Next" link go
through unhindered.

Hope this helps!

---
Jason Bauer
jbauer at chimesnet.com
Programmer/Analyst
Chimes, Inc.







More information about the thelist mailing list