Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl search script question

Status
Not open for further replies.

dharmachic

Technical User
Dec 18, 2000
24
0
0
US
Hi all,
I'm a bit new to perl but familiar enough to create basic forms. I've created several drop down lists for an advance search and would like the search results to contain only the precise criteria selected. Is there a particular command I could just add?

Thanks in advance,

dHaRmAcHic ;)
 
It's unclear what you are trying to do. Could you be more specific and perhaps provide some relevant code (html and/or Perl)? What are you trying now that isn't working?

jaa
 
OK, here's my form:
<form action=ezwebstore.cgi method=post>
<div align=&quot;center&quot;><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Search
by Keyword:
<input type=&quot;text&quot; name=&quot;keywords&quot; size=&quot;16&quot; maxlength=&quot;60&quot; value=&quot;&quot;>
<br>
<br>
or use our Advanced Search<br>
</font></div>
<table cellspacing=2 cellpadding=2 width=400 border=0>
<tr>
<td align=left width=33%><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Jewelry
Type </font></td>
<td align=left width=&quot;33%&quot;><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Special</font></td>
<td align=left width=&quot;33%&quot;><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Stone
Shape </font></td>
</tr>
<tr>
<td align=left width=&quot;33%&quot;> <font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
<select name=&quot;category&quot;>
<option value=&quot;-----&quot; selected>-----</option>
<option value=&quot;RINGS&quot;>RINGS</option>
<option value=&quot;BRACELETS&quot;>BRACELETS</option>
</select>
</font></td>
<td align=left width=&quot;33%&quot;> <font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
<select name=&quot;userDefinedFour&quot;>
<option value=&quot;-----&quot; selected>-----</option>
<option value=&quot;BASIC&quot;>BASIC</option>
<option value=&quot;FASHION&quot;>FASHION</option>
<option value=&quot;HIGH LINE&quot;>HIGH LINE</option>
<option value=&quot;LIGHT WEIGHT&quot;>LIGHT WEIGHT</option>
<option value=&quot;FLAT BACK&quot;>FLAT BACK</option>
</select>
</font></td>
<td align=left width=&quot;33%&quot;> <font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
<select name=&quot;userDefinedOne&quot;>
<option value=&quot;-----&quot; selected>-----</option>
<option value=&quot;Oval&quot;>Oval</option>
<option value=&quot;Octagon&quot;>Octagon</option>
<option value=&quot;Cush&quot;>Cush</option>
<option value=&quot;Pear&quot;>Pear</option>
<option value=&quot;Wavette&quot;>Wavette</option>
<option value=&quot;Diamond&quot;>Diamond</option>
<option value=&quot;Heart&quot;>Heart</option>
<option value=&quot;Round&quot;>Round</option>
<option value=&quot;Trillion&quot;>Trillion</option>
</select>
</font></td>
</tr>
<tr>
<td align=left width=33%><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Style
</font></td>
<td align=left width=&quot;33%&quot;><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>Stone
Size </font></td>
<td align=left width=33%><font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;> </font></td>
</tr>
<tr>
<td align=left width=&quot;33%&quot;> <font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
<select name=&quot;userDefinedFive&quot;>
<option value=&quot;-----&quot; selected>-----</option>
<option value=&quot;STONE&quot;>STONE</option>
<option value=&quot;PEARL&quot;>PEARL</option>
<option value=&quot;ALL DIAMOND&quot;>ALL DIAMOND</option>
<option value=&quot;NO DIAMOND&quot;>NO DIAMOND</option>
</select>
</font></td>
<td align=left width=&quot;33%&quot;> <font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
<select name=&quot;name&quot;>
<option value=&quot;-----&quot; selected>-----</option>
<option value=&quot;5x3&quot;>5x3</option>
<option value=&quot;5x4&quot;>5x4</option>
<option value=&quot;6x3&quot;>6x3</option>
<option value=&quot;6x4&quot;>6x4</option>
<option value=&quot;7x5&quot;>7x5</option>
<option value=&quot;8x4&quot;>8x4</option>
<option value=&quot;8x5&quot;>8x5</option>
<option value=&quot;8x6&quot;>8x6</option>
<option value=&quot;9x6&quot;>9x6</option>
<option value=&quot;9x7&quot;>9x7</option>
<option value=&quot;10x4&quot;>10x4</option>
<option value=&quot;10x5&quot;>10x5</option>
<option value=&quot;10x7&quot;>10x7</option>
<option value=&quot;10x8&quot;>10x8</option>
<option value=&quot;11x9&quot;>11x9</option>
<option value=&quot;12x6&quot;>12x6</option>
<option value=&quot;12x10&quot;>12x10</option>
<option value=&quot;14x10&quot;>14x10</option>
<option value=&quot;14x12&quot;>14x12</option>
<option value=&quot;16x8&quot;>16x8</option>
<option value=&quot;16x12&quot;>16x12</option>
<option value=&quot;18x9&quot;>18x9</option>
<option value=&quot;18x13&quot;>18x13</option>
<option value=&quot;4mm&quot;>4mm</option>
<option value=&quot;5mm&quot;>5mm</option>
<option value=&quot;5.5&quot;>5.5</option>
<option value=&quot;6mm&quot;>6mm</option>
<option value=&quot;7mm&quot;>7mm</option>
<option value=&quot;7.5&quot;>7.5</option>
<option value=&quot;8mm&quot;>8mm</option>
</select>
</font></td>
<td align=left width=&quot;33%&quot;> <font size=&quot;2&quot; face=&quot;Verdana, Arial, Helvetica, sans-serif&quot;>
<input type=&quot;hidden&quot; name=&quot;cart_id&quot; value=&quot;&quot;>
<input type=&quot;submit&quot; name=&quot;search_request_button&quot; value=&quot;Search&quot;>
</font></td>
</tr>
</table>
<br>
</form>

Right now the search brings up any item that falls under any of the catagories in the fields. I would like it to ONLY find the specific fields that are requested. I'm using the open source ezwebstore script. I think this might be the line that needs to be altered:

$search_request = $form_data{'search_request_button'};
$cart_id = $form_data{'cart_id'};

Does that help clear things up? Thanks!!!
 
From the look of your form there is no one particular command that you can add. You need to parse the values sent from the form to the cgi script and only add values to the search list if they are defined (or, rather, if they don't eq &quot;-----&quot;).

jaa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top