Gossamer Forum
Home : Products : DBMan : Customization :

Radio Button Search Different Databases

Quote Reply
Radio Button Search Different Databases
Hello Everyone
Here is what I'm trying to do.
Is have a HTML Search Page that will search different databases based on witch box you check.

Example
I have radio box categories. Car Models
1st choice "Ford"
2nd choice "GM"
Ect.

Each choice is a database so if someone clicks ford check box it will search the Ford database for the keyword they submited.



[This message has been edited by computel (edited July 18, 1999).]
Quote Reply
Re: Radio Button Search Different Databases In reply to
Name your .cfg files -- ford.cfg, gm.cfg, etc. Your radio buttons would be

<input type="radio" name="db" value="ford">Ford
<input type="radio" name="db" value="gm">GM

etc.

Is this on a static html page or a form that is created by DBMan?


------------------
JPD





Quote Reply
Re: Radio Button Search Different Databases In reply to
Sorry. I didn't know you needed the whole form.

Code:
<form action="http://server.com/cgi-bin/db.cgi" method="GET">
<input type=hidden name="uid" value="default">
<INPUT TYPE="TEXT" NAME="keyword" SIZE=15 MAXLENGTH=255> Keyword Search <P>
Which database?<BR>
<input type="radio" name="db" value="ford">Ford
<input type="radio" name="db" value="gm">GM
<INPUT TYPE="SUBMIT" NAME="view_records" VALUE="Search">
<INPUT TYPE="RESET" VALUE="Reset">
</form>

This is assuming that you have ford.cfg and gm.cfg in the same directory as db.cgi.


------------------
JPD





Quote Reply
Re: Radio Button Search Different Databases In reply to
This is a html page I create. I need it to be able to load the right database and also take the keywords typed in by the user and search the database that was selected by the radio button.

Thanks


------------------
Lowest Price On All Your Product Needs.

http://www.compu-tel.on.ca/products

[This message has been edited by compu_tel (edited July 19, 1999).]
Quote Reply
Re: Radio Button Search Different Databases In reply to
Well, that should do it. You'll need a different .cfg file for each of your databases.


------------------
JPD





Quote Reply
Re: Radio Button Search Different Databases In reply to
Please provide what the string would look like in a form html page. I have tried everything and it never works.

I can't get it to load the correct database and log the user on as default user and then get the keywords from the search string they entered.

Thanks For you time.


------------------
Lowest Price On All Your Product Needs.

http://www.compu-tel.on.ca/products
Quote Reply
Re: Radio Button Search Different Databases In reply to
Thanks for all your help and I will let you know how it works out.

Quote Reply
Re: Radio Button Search Different Databases In reply to
It worked. Thanks for all your help.
Quote Reply
Re: Radio Button Search Different Databases In reply to
Hello Everyone
I was wondering if anyone has a script that will track the search words used on the database by users?.

Here is what i need to do. Say a user searches for the word Ford Mustang on my Ford database. I need to know the time and user that did the search along with the search words.

Thanks
Quote Reply
Re: Radio Button Search Different Databases In reply to
You could probably add some code to sub view_records in db.cgi -- something like this. (The new code is in bold print.)

Code:
my ($status, @hits) = &query("view");
if ($status eq "ok") {
foreach $col ($db_cols) {
if ($in{$col}) {
$log_terms .= "$in{$col}, ";
}
}
&auth_logging("searched for $log_terms");
&html_view_success(@hits);
}
else {
&html_view_failure($status);
}

Don't know if that will give you what you want, but it might.


------------------
JPD





Quote Reply
Re: Radio Button Search Different Databases In reply to
JPDeni

In the above message that is what I wanted to have it show the logon and the search for.

I tried the string and this what it shows in the log file.

default searched for at 18:48:16 on 29-Jul-1999 from 206.222.77.79
default searched for at 18:49:58 on 29-Jul-1999 from 206.222.77.79
default searched for at 18:52:55 on 29-Jul-1999 from 206.222.77.79

For some reason its not taking the words that are found in the database and putting it in the log file.

It's almost there. Just getting the log to grab the words and put them in the log files.


Thanks for all your help just this one more thing and I will be done. JPDeni how much do you charge you time as I would like to give you something for your time & help.

If you don't take cash I will send you a gift cert for CD Now.
Quote Reply
Re: Radio Button Search Different Databases In reply to
Are you using a keyword search? If so, try adding

Code:
$log_terms = $in{'keyword'};

just before

&auth_logging("searched for $log_terms");

Don't worry about paying me. Please donate to a children's charity and I'll be happy.



------------------
JPD





Quote Reply
Re: Radio Button Search Different Databases In reply to
I don't think DBMan will be able to figure out if they clicked a URL. This is getting into a feature of Links which I don't understand at all.

Re donation: That would be wonderful!

------------------
JPD





Quote Reply
Re: Radio Button Search Different Databases In reply to
Hello JPDeni

I will try that code above.

Would it be possible to have the database log also let me know if the customer clicked any of the URL's they found after the search. I wouldn't mind knowing if they clicked on the url field.

Thanks

I will make a donation to sick kids where I live in your name JP Deni is this correct?
Quote Reply
Re: Radio Button Search Different Databases In reply to
Hello JPDeni

I just realized I was using the default to log people into the database search so the log shows default. Each sales rep has a logon just for view access so I need the log to show there name. I goto my html set to

<form
action="http://www.server/cgi/db.cgi"
method="GET">
<input type="hidden" name="uid" <Value="John">

How do I get the password to input in the html so it logs in as John.

here is what i tried but no luck

<form
action="http://server/cgi/db.cgi"
method="GET">
<input type="hidden" name="uid" value="john">
<input type="hidden" name="pw" value="2EjBLyrAyhTXQ">

Thanks Again
Quote Reply
Re: Radio Button Search Different Databases In reply to
It looks like you're using the encrypted password. Try using the unencrypted password.


------------------
JPD





Quote Reply
Re: Radio Button Search Different Databases In reply to
Hello JPDeni

I tried both ways and I get the logon screen in DBMan. I need to by pas that and just logon the user. with out using the default but with names I give people.

Thanks
Quote Reply
Re: Radio Button Search Different Databases In reply to
Let's try it again. Smile

Code:
<form action="http://server/cgi/db.cgi" method="post">
<input type=hidden name="db" value="default">
<input type="hidden" name="userid" value="john">
<input type="hidden" name="pw" value="unencrypted password
<INPUT TYPE="SUBMIT" name="login" VALUE="Logon">

You could use a link instead:

<a href="http://server/cgi/db.cgi?db=default&userid=john&pw=unencrypted password">



------------------
JPD





Quote Reply
Re: Radio Button Search Different Databases In reply to
Hello JPDeni

Here is the html

<form action="http://server/cgi/carparts/db.cgi" method="GET">
<input type="hidden" name="uid" value="john">
<input type="hidden" name="pw" value="cardealer">

<div
align="center"><center><table border="0" cellpadding="0"
cellspacing="0">

<tr>
<td colspan="5"><font color="#000000" size="3"
face="Arial">Select a Category: </font></td>
</tr>
<tr>
<td width="10"><font color="#FF0000"></font> </td>
<td><font color="#FF0000" size="4" face="Arial"><input
type="radio" name="db" value="GM"></font><font
color="#FF0000" size="3" face="Arial">GM</font></td>
<td><font color="#FF0000" size="4" face="Arial"><input
type="radio" name="db" value="Ford"></font><font
color="#FF0000" size="3" face="Arial">Ford</font></td>
<td><font color="#FF0000" size="4" face="Arial"><input
type="radio" name="db" value="VW"></font><font
color="#FF0000" size="3" face="Arial">VW</font></td>
</tr>

<tr>
<td> </td>
<td align="center" colspan="2"><font color="#000000"
size="3" face="Arial">Enter Keywords:</font></td>
</tr>
<tr>
<td width="10"> </td>
<td colspan="4"><p align="center"><input type="text"
size="15" maxlength="255" name="keyword"> <input
type="submit" name="view_records" value="Search"> <input
type="reset" value="Reset"><br>
</p>
</td>
</tr>
</table>
</center></div>
</form>

this should give you a better idea what I'm doing.


I'm tring to log a user on and display the search they entered in the keywords field with out the dbman logon screan poping up. Just like the default does.

Thanks
Quote Reply
Re: Radio Button Search Different Databases In reply to
Hello JPDeni

I figured it out.

I had to add this line
<input type="hidden" name="login" value="1">

so it now looks like this

<form
action="http://server/cgi/carparts/db.cgi"
method="get">
<input type="hidden" name="userid" value="custid12">
<input type="hidden" name="pw" value="custid12">
<input type="hidden" name="login" value="1">

Thanks again