Gossamer Forum
Home : Products : DBMan : Customization :

Another question (small this time)

Quote Reply
Another question (small this time)
Hi everyone,

I have another question. On a static html page I have the following code:

<form action="http://www.myserver.com/db.cgi" method="GET">
<input type=hidden name="db" value="default">
<input type=hidden name="uid" value="default">
<INPUT TYPE="TEXT" NAME="keyword">
<INPUT TYPE="IMAGE" name="view_records_front" value="Submit" SRC="images/b_dot.gif" border="0">
<input type="hidden" name="view_records_front" value="Submit">
</form>

What can I do so that when a search is entered there it only searches on members that are the type "full". It has the value "full" in the type field. Any ideas?

Quote Reply
Re: Another question (small this time) In reply to
Believe it or not, it's not such an easy question Smile

Normally you could just add one more hidden field with NAME="type" and VALUE="full", but this won't work in this particular instance.

When you perform a KEYWORD search, DBMan looks at the "keyword" field only, and ignores everything else.

So it will take some hacking of the Query sub-routine... Unless anyone else has another solution?

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Another question (small this time) In reply to
Oh damn. I thought it would be.

Can someone modify the query sub-routine for me.

Thanks for posting a response Mark.

Quote Reply
Re: Another question (small this time) In reply to
As Mark said keyword searches are different, but you may want to include this line and see if it will work:

<INPUT TYPE=HIDDEN NAME="Validated" VALUE="Yes">

Changing "Validated" to the name of your field and "Yes" to "Full".

I believe I have used this with keyword searches and have had it only display records which were validated.

Hope that will work

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Another question (small this time) In reply to
I tired that and it didn't work :(

Quote Reply
Re: Another question (small this time) In reply to
In Reply To:
On a static html page I have the following code:

<form action="http://www.myserver.com/db.cgi" method="GET">
Check with your host provider - many servers will not allow the GET command from outside a script.


Quote Reply
Re: Another question (small this time) In reply to
I don't think he's having a problem with the "GET" command, just trying to get the search working with only "Full" users. I wish I could help you out with this particular query, but I am the only "user" using my database, so I don't have any experience with different user settings. Good luck though.

=Blake=
http://www.movielocity.com

Quote Reply
Re: Another question (small this time) In reply to
Hi Guys,

Yes you got it right BlakeK. I just want the search to return Full members. It's working at the moment but it returns Allied and OTOC members when I don't want it to.

Quote Reply
Re: Another question (small this time) In reply to
Has anyone got any further suggestions.

I really need a solution to this.

Quote Reply
Re: Another question (small this time) In reply to
Guess I'll ask the obvious then <smile> Have you tried adding a field such as:

<input type=hidden name="type" value="full">

above the keyword field?

I'm also curious on why you have two Submit fields in the example above???

Quote Reply
Re: Another question (small this time) In reply to
Yes I've tried that Karen and it didn't work :(

I'm using a picture as a submit button. Thats the reason why.

Quote Reply
Re: Another question (small this time) In reply to
What I've done now is created a frameset for my frontpage instead of having it in tables
so that I can provide a link to a procedure in the html.pl file through the frameset.

I want to have one textbox that searches two fields ("Name" and "Address2") where it only returns "full" members (type field).

Is there a solution now? Please help :)

If you need me to explain it more please let me know.

Quote Reply
Re: Another question (small this time) In reply to
I also tired using the "Simultaneous field searching" mod at http://webmagic.hypermart.net/dbman/ but I keep on getting:

"There were problems with the search. Reason: no search terms specified Please fix any errors and submit the search again."

even when I put something inside the textbox. Here are my modifications for that script:

---

sub combined_field_search {
# --------------------------------------------------------
# This sub will let you search on specific fields from just one field in the search form. The
# name in the search form must be unique, meaning that it can not be the same name as any of your fields in the db.cfg.
# Set this to the unique name from the search form

my ($search_term) = 'agent_finder';

# Set this list below to match the field names that you would like to search from your one input field.
# The list should be seperated with commas and each field should be enclosed with singe quote "'".

my (@multi_fields) = ('Name','Address2');
# Check to see $search_term was even queried if not then we don't need to do anything

if (!$in{$search_term}) { return; }

# Now we know that we are going to need to search more than one field on this search so we
# are going to populate the $in variable as if the search was made individually for each field

my ($field);
foreach $field (@multi_fields) {
$in{$field} = $in{$search_term};
}

# If Match Any is off this search will only return the records where all of the fields contain the search term.
$in{'ma'} = 'on';
}

***

sub view_records {
# --------------------------------------------------------
# This is called when a user is searching the database for
# viewing. All the work is done in query() and the routines just
# checks to see if the search was successful or not and returns the user to the appropriate page.
# Added this sub to populate the $in variable with some more search fields if neccessary

&combined_field_search;

if ($in{'Type'} eq 'Full') {
$in{'Type'} = 'Full|OTOC'; $in{'re'} = 'on';
}
my ($status, @hits) = &query("view");
if ($status eq "ok") {
&html_view_success(@hits);
}
else {
&html_view_failure($status);
}
}

**

<input type="text" name="agent_finder" size="20">

**

Any ideas why I'm getting that error?