Gossamer Forum
Home : Products : DBMan : Customization :

Problem with a search from an html form..

Quote Reply
Problem with a search from an html form..
Hi all,
I have a db set up and all was well till the client requested some changes. I had a little check box ('inc') which told the db which records to include when listing them in a public part of a private website..... worked fine for many months.

Now i have added another checkbox, because they wanted some records to appear on the public site, but not in the private site. No problem, so i added another checkbox ('mem'). This all work fine, until i use it in combination with a keyword search.

For my 'List All' links which work great, the code is.....

http://etc......../cgi-local/news_archive/db.cgi?db=default&uid=default&view_records=1&inc=y&ID=*&sb=2&so=descend.

As you night have guessed, i get a nice list of all public records with the checkbox 'inc' set to y. Cool!!

On the same page i have a keyword search from an html form. A section of the code is.....

<FORM ACTION="http://etc......cgi-local/news_archive/db.cgi" METHOD="GET">
<INPUT TYPE="hidden" name="db" value="default">
<INPUT TYPE="hidden" name="uid" value="default">
<input type="hidden" name="view_records" value="1">
<input type="hidden" name="inc" value="y">
<input type="hidden" name="sb" value="2">
<input type="hidden" name="so" value="descend">
<INPUT TYPE="TEXT" NAME="keyword" SIZE=30 MAXLENGTH=255>
<INPUT TYPE="SUBMIT" NAME="view_records" VALUE="Search">
</FORM>

Now to my untrained eye that looks like it'll do the trick, but if i search for a keyword that appears in a private record (e.g. inc="") it shows that record in the public search results.

The code in the browser for the search results is....

http://etc...../cgi-local/news_archive/db.cgi?db=default&uid=default&view_records=1&inc=y&sb=2&so=descend&keyword=members&view_records=Search

My question then, at last, is how do i exclude the records that don't have 'inc=y' as the keyword search seems to ignore that parameter and search the whole database, including private records?

Looking at the code above, when i hit the search button maybe it does search for the correct records first of all, then when it adds on the 'keyword=private&view_records=Search' code it sort of starts again and searches the whole database....

Kind regards

Phil Marsh