Associate Engine : Script Parameters | |||||
|
Before reading this section, we recommend that you start with the Quick Tutorial of Parameters.
|
The Associate Engine script can be called either via a link or via a form. Specifically, parameters can be passed to the script via the GET method or the POST method.
GET Method (Links or Forms)
The GET method means that you can put the parameters into the URL of a clickable link, such as:
Associate Engine uses the internet's standard way of specifying parameters. That is, each parameter is a NAME=VALUE pair and pairs are separated by the & symbol.
Note: If the NAME is specified without a value (e.g.:
/cgi-bin/ae.pl?script&type=best&mode=books ), then the value defaults to 1 thus script=1 can be abbreviated to script
POST Method (Forms)
The POST method is used in forms (note: the GET method can also be used in forms).
Set the ACTION of your form to be the URL of ae.pl on your webserver, e.g.:
<FORM ACTION="/cgi-bin/ae.pl" METHOD="POST"> Form fields are used to specify the parameters. Hidden form fields can be used to specify parameters that you don't want the user to be able to change. For example, the following form does a search of DVD's for the user-specified keywords:
<FORM ACTION="/cgi-bin/ae.pl" METHOD="POST"> <INPUT TYPE="HIDDEN" NAME="mode" VALUE="dvd"> <INPUT TYPE="TEXT" NAME="keyword"> <INPUT TYPE="SUBMIT" VALUE="Search"> </FORM>Note:If you want the user to be able to bookmark the results page that appears when they submit the form, then change the <FORM> and use METHOD="GET" instead. Web browsers cannot properly bookmark any webpage that was reached from a form that has METHOD="POST" since the resulting URL in the web browser's Location box does not contain any parameters (i.e.: it has no
?PARAMETERS ).
Several types of searches are supported. The type of search to perform is specified by what parameter is used (described below). There are also optional parameters can be used to modify the search, such as what page to start at, how to sort the results, and what price range to filter on.
amazon.com Sections
Most search types (not all) require you to specify what product section of amazon.com to search in, such as the Books section, the DVD section, the Toys section, etc. The mode parameter is used to specify the product section. Its possible values are:
amazon.com Section | amazon.com mode | amazon.co.uk mode |
Apparel | apparel | apparel |
Arts & Crafts | not supported | n/a |
Automotive | automotive | not supported |
Baby | baby | baby |
Beauty | beauty | beauty |
Books | books | books |
Classical Music | classical | classical |
DVD | dvd | dvd |
Electronics | electronics | electronics |
Gourmet Food | gourmetfood | n/a |
Groceries | grocery | not supported |
Health and Personal Care | healthpersonalcare | healthpersonalcare |
Home & Garden | homegarden | homegarden |
Industrial | industrial | n/a |
Jewelry | jewelry | jewelry |
Amazon.com Kindle | kindlestore | kindlestore |
Kitchen | kitchen | kitchen |
Lighting | n/a | not supported |
Magazines | magazines | n/a |
Mobile Apps for Android | mobileapps | n/a |
MP3 Music Downloads | mp3downloads | not supported |
Popular Music | music | music |
Musical Instruments | musicalinstruments | not supported |
Office Products | officeproducts | not supported |
Outdoor Living, Lawn & Patio | outdoorliving | outdoorliving |
Personal Computers | pchardware | not supported |
PetS upplies | petsupplies | n/a |
Cameras & Photography | photo | n/a |
Shoes | not supported | not supported |
Software | software | software |
Sporting Goods | sportinggoods | sportinggoods |
Software Video Games | n/a (see videogames) | softwarevideogames |
Tools & Hardware | tools | tools |
Toys | toys | toys |
Unbox Video Downloads | unboxvideo | n/a |
VHS Videos | vhs | vhs |
DVD & VHS | video | video |
Video Games | videogames | videogames |
Watches | watches | watches |
Wireless Phones & Service | wireless | n/a |
Wireless Accessories | wirelessaccessories | n/a |
Thus mode=books causes the Books section to be searched.
Some sections are combinations of other smaller sections so you can search multiple sections all at once. For example, video is a combation of the dvd and vhs sections. The combinations are:
Combined mode Individual mode's blended Apparel, Automotive, Books, DVD, Electronics, GourmetFood, HealthPersonalCare, Kitchen, Music, PCHardware, PetSupplies, Shoes, Software, SoftwareVideoGames, SportingGoods, Tools, Toys, VHS, VideoGames Note: blended does not include all the possible store sections.
music Classical, DigitalMusic, MusicTracks video dvd, vhs Note: amazon.co.uk uses different mode values. See: Using Associate Engine with amazon.co.uk.
Search Types
The following table shows what parameters to use for the various search types. Text shown in green (e.g.: MODE) indicates a value that you need to specify. For example, mode=MODE means that you should replace MODE with one of the possible modes (see table above).
Search Type | Parameters to Use |
Section homepage |
type=browse&mode=MODE Example: type=browse&mode=books |
Bestsellers of a section |
type=bestsellers&mode=MODE Example: type=bestsellers&mode=vhs |
Keyword search of a section |
type=search&mode=MODE&keyword=KEYWORDS |
Keyword search of all sections (blended search) |
type=search&mode=blended&keyword=KEYWORDS |
Section subpage (browse node) |
type=browse&mode=NODE Example: type=browse&mode=578324 See: FAQ "How do I determine the browse number to use in type=browse&mode=NUMBER ?" |
Keyword search of section subpage (browse node with keyword) |
type=bestsellers&mode=NODE&keyword=KEYWORDS Example: type=bestsellers&mode=578324&keyword=abs Note: Since browse node 578324 is a top-level section page, you need to use type=bestsellers rather than type=browse. |
ASIN Search |
asinsearch=ASIN One or more ASIN's can be specified separated by comma. A list of ASIN's can also be put into an ASIN file. ASIN's and ASIN list names can be mixed together in the parameter value. This parameter supports Clock Codes. Examples: |
ISBN Search of books |
asinsearch=ISBN One or more ISBN's can be specified separated by comma. A list of ISBN's can also be put into an ASIN file (ISBN's and ASIN's are equivalent for books). ISBN's and ASIN list names can be mixed together in the parameter value. This parameter supports Clock Codes. Example: asinsearch=0439567629 |
UPC Search of popular music or classical music |
upcsearch=UPC&mode=MODE Possible values for MODE are music and classical. The default mode is music. One or more UPC's can be specified separated by comma. A list of UPC's can also be put into a UPC list text file. UPC's and UPC list names can be mixed together in the parameter value. This parameter supports Clock Codes. Example: upcsearch=696998718524&mode=music |
Book Author Search |
authorsearch=NAME Example: authorsearch=Wayne+Dyer |
Power Search (advanced search of books) |
powersearch=QUERY |
Musical Artist Search in popular music or classical music |
artistsearch=NAME&mode=MODE Possible values for MODE are music and classical. The default mode is music. Example: artistsearch=Celine+Dion&mode=music |
Actor/Actress Search in VHS or DVD's |
artistsearch=NAME&mode=MODE Possible values for MODE are vhs, dvd, and video (both VHS and DVD's). The default mode is video. Example: actorsearch=Harrison+Ford&mode=dvd |
Director Search in VHS or DVD's |
directorsearch=NAME&mode=MODE Possible values for MODE are vhs, dvd, and video (both VHS and DVD's). The default mode is video. |
Manufacturer Search |
manufacturersearch=NAME&mode=MODE Possible values for MODE are electronics, kitchen, videogames, software, photo, and pc-hardware. The default mode is electronics. |
Listmania! Search |
listmaniasearch=LISTID Example: listmaniasearch=34TRCFE5HC23M
|
WishList Search |
wishlistsearch=WISHLISTID Example: wishlistsearch=BUWBWH9K2H77 |
For more examples, see the "Overview" section and the "Sample HTML" section.
Search Parameters
Parameter | Default | Description (default shown in red) |
type | bestsellers |
The "type" parameter indicates what type of page at amazon.com you want to display. The "type" parameter is used in conjunction with the "mode" and "search" parameters. Possible values are:
|
mode | books |
The "mode" parameter indicates what subtype of page at amazon.com you want to display. The "mode" parameter is used in conjunction with the "type" parameter. Possible values for the "mode" parameter depend upon the value used for the "type" parameter as indicated below. These values for "mode" are the same values that amazon.com uses for its own "mode " parameter. The links below are live working examples. Try them out. The "show as grid" link shows what happens when the grid script parameter is also specified (in these examples it is set to "grid=c:3,r:4,v"). For more examples, see the "Overview" section and the "Sample HTML" section.
|
keyword | (empty) |
Optional parameter that specifies keywords used to do a search. If used as part of a URL, separate keywords with a plus sign (+) character; this is converted to a space character (e.g.: " |
search | (empty) |
Optional parameter that specifies a search that was pre-defined in the configuration file. See search.* configuration variables. |
Search Modifier Parameters
The following optional parameters modify the search.
Parameter | Default | Description (default shown in red) |
first | 1 |
Optional parameter that specifies what result number to start at. The default is 1. The number of results on the page is specified via the pagesize script parameter or the pagesize configuration variable. |
page | 1 |
Optional parameter that specifies what page to start the results at. The default is page 1. The number of results on the page is specified via the pagesize script parameter or the pagesize configuration variable. |
price | (empty) |
Optional parameter that specifies the price range to filter products with. Only products within the specified price range will be displayed. The minimum and maximum prices are specified as |
sort | (empty) |
Optional parameter that specifies the sort order of results. The default is to sort by decreasing sales rank. The possible values of this parameter vary depending upon the type of search being performed. See Sorting the Results. |
Sorting the Results
The results can be sorted in various ways by using the sort parameter. The possible values of the Associate Engine sort parameter vary depending upon the type of search being performed.
The following tables are based on the AWS API Guide documentation (version 9-Feb-2004). The Associate Engine sort parameter is passed directly to Amazon Web Services (AWS) as is. The values of the sort parameter shown below were choosen by Amazon.com as part of AWS; comments about inconsistencies should be address to Amazon.com Associates management :)
NOTE: The order of results returned by AWS may not exactly match the order of results displayed on the amazon.com website. This is due to the sort algorithm used by AWS (Associate Engine does not do the sorting; AWS does the sorting); comments about differences in results between AWS and the amazon.com website should be addressed to Amazon.com Associates management :)
Sorting Books Results
(US: mode=books) (UK: mode=books-uk)Sort Type sort Parameter Featured Items +pmrank Bestselling +salesrank Average Customer Review +reviewrank Price (Low to High) +pricerank Price (High to Low) +inverse-pricerank Publication Date +daterank Alphabetical (A-Z) +titlerank Alphabetical (Z-A) -titlerank
Sorting Camera and Photo Results
(US: mode=photo)Sort Type sort Parameter Featured Items +pmrank Bestselling +salesrank Alphabetical (A-Z) +titlerank Alphabetical (Z-A) -titlerank
Sorting Computers Results
(US: mode=pc-hardware)Sort Type sort Parameter Featured Items +psrank Bestselling +salesrank Alphabetical (A-Z) +titlerank Alphabetical (Z-A) -titlerank
Sorting DVDs Results
(US: mode=dvd) (UK: mode=dvd-uk)Sort Type sort Parameter Bestselling +salesrank Alphabetical +titlerank
Sorting Electronics Results
(US: mode=electronics) (UK: mode=electronics-uk)Sort Type sort Parameter Featured Items +pmrank Bestselling +salesrank Alphabetical +titlerank Review +reviewrank
Sorting Kitchen Results
(US: mode=kitchen) (UK: mode=kitchen-uk)Sort Type sort Parameter Featured Items +pmrank Bestselling +salesrank Alphabetical (A-Z) +titlerank Alphabetical (Z-A) -titlerank Manufacturer (A-Z) +manufactrank Manufacturer (Z-A) -manufactrank Price (Low to High) +price Price (High to Low) -price
Sorting Music & Classical Music Results
(US: mode=music or classical) (UK: mode=music or classical)Sort Type sort Parameter Featured Items +psrank Bestselling +salesrank Artist Name +artistrank Original Release Date +orig-rel-date Alphabetical +titlerank
Sorting Outdoor Living Results
(US: mode=garden)Sort Type sort Parameter Featured Items +psrank Bestselling +salesrank Alphabetical (A-Z) +titlerank Alphabetical (Z-A) -titlerank Manufacturer (A-Z) +manufactrank Manufacturer (Z-A) -manufactrank Price (Low to High) +price Price (High to Low) -price
Sorting Software Results
(US: mode=software) (UK: mode=sw-vg-uk)Sort Type sort Parameter Featured items +pmrank Bestselling +salesrank Alphabetical +titlerank Price (High to Low) +price Price (Low to High) -price
Sorting Tools Results
(US: mode=tools)Sort Type sort Parameter Featured Items +psrank Bestselling +salesrank Alphabetical (A-Z) +titlerank Alphabetical (Z-A) -titlerank Manufacturer (A-Z) +manufactrank Manufacturer (Z-A) -manufactrank Price (Low to High) +price Price (High to Low) -price
Sorting Toys Results
(US: mode=toys) (UK: mode=toys-uk)Sort Type sort Parameter Featured Items +pmrank Bestselling +salesrank Price (Low to High) +pricerank Price (High to Low) +inverse-pricerank Alphabetical (A-Z) +titlerank
Sorting Video Results
(US: mode=vhs) (UK: mode=vhs-uk)Sort Type sort Parameter Featured Items +psrank Bestselling +salesrank Alphabetical +titlerank
Sorting Video Games Results
(US: mode=videogames) (UK: mode=video-games-uk)Sort Type sort Parameter Featured Items +pmrank Bestselling +salesrank Alphabetical +titlerank Price (Low to High) +price Price (High to Low) -price
Parameter | Default | Description (default shown in red) | ||||||||||||||||||||||||||||||||||||
format | (empty) |
Optional parameter that specifies the name of the formatting file to be used. See: Format Templates. This parameter can contain Clock Codes. |
||||||||||||||||||||||||||||||||||||
grid | (empty) |
Optional parameter that specifies format used to reformat results into a grid. Each product in the grid shows a product name (linked), a subtitle of more information (if available), and a product thumbnail image (if available; otherwise "[no image]" is shown). The format of this parameter is one or more options separated by commas, that is, " This parameter can also be set based on the value of a user defined configuration variable. If "grid=xNAME", then the script uses the value of the configuration variable "xgridNAME" (NAME is optional, in which case, variable "xgrid" is used). This is similar to the concept of styles in a word processor program. By changing the value of the configuration variable xgridNAME, all your grids that use the xNAME style thus change without you having to change all your HTML files. This is particularly useful if you have a lot of grids in your website that use the same format and you want to change them all at once. The possible OPTION's are:
Some examples are:
Empty rows and empty columns are automatically removed. If vertical fill is selected and there are not enough items to fill the grid, the number of rows is automatically reduced so more columns are filled. Note: Blended search does not support the grid parameter. |
||||||||||||||||||||||||||||||||||||
list | 0 (zero) |
If this script parameter is specified, then the results are shown in list format (non-grid) even if the grid configuration parameter is set or if the grid script parameter is specified. You would use this list script parameter in the situation where you have the grid configuration parameter set (since you want most results to default to a grid mode) and you want certain pages to be shown in list format. The list script parameter lets you override the grid configuration parameter and the grid script parameter. E.g.: Harry Potter books (as grid), Harry Potter books (as list) -- note the difference between these two URL's. Note: If you include "list" in the URL, then the value 1 is implied so you can simply say: |
||||||||||||||||||||||||||||||||||||
nocredit | 0 (zero) |
If specified then the "Powered by..." credit line is not included in the results. Note: If you include "nocredit" in the URL, then the value 1 is implied so you can simply say: Note: Set the credit configuration variable to no to turn off the credit line so you don't have to specify the nocredit parameter in all your links. |
||||||||||||||||||||||||||||||||||||
pagesize | pagesize configuration variable |
Optional parameter that specifies the number of results to show per page. If not specified, then the default is based on the pagesize configuration variable (which is typically 10). |
||||||||||||||||||||||||||||||||||||
template | (empty) |
Optional parameter that specifies the name of the Page Template file to be used. The name can be one or more letters/numbers (e.g.: mybooks, topvideos, music2). Note: Maximum length of name is 32 letters/numbers, and uppercase letters are converted to lowercase. See the "Page Templates" section for details. This parameter can contain Clock Codes. |
||||||||||||||||||||||||||||||||||||
title | (empty) |
The page title can be specified via the title script parameter, for example: |
||||||||||||||||||||||||||||||||||||
xNAME | (empty) |
User defined Page Template variable xNAME. The NAME is one or more letters/numbers, such as "xtitle". Uppercase/lowercase in the name does not matter. For example, if the script is called with "xtitle=My+Favorites" (+ use for spaces), then the variable <!--xtitle--> will be replaced by the text My Favorites. If the Page Template contains a variable that was not specified when calling the script and was not defined in the configuration file, then the value "(undefined variable: NAME)" is used. When the script substitutes in the value of a user-defined substitution variable, the value is automatically HTML encoded ("<" becomes "<", ">" becomes ">", quotation mark becomes """, " &" becomes "&"). |
You can run the script in various ways. If you run it using a Server-Side-Include (SSI) statement, a PHP virtual() function call, a PHP file_get_contents() function call, or using a <SCRIPT> tag, or using an <IFRAME> tag, then one of the following parameters must be specified.
See Quick Tutorial for a tutorial on using <SCRIPT> tags and SSI statement.
Parameter | Default | Description (default shown in red) |
script | 0 (zero) |
Optional parameter that specifies that output is to be formatted for inclusion in an HTML page using a <SCRIPT> tag. This parameter causes the template script parameter to be ignored and the output is just "{results}". For better looking results, try also using the grid script parameter. See <SCRIPT> in the Sample HTML section for an example. Note: If you include "script" in the URL, then the value 1 is implied so you can simply say: |
iframe | 0 (zero) |
Optional parameter that specifies that output is to be formatted for inclusion in an HTML page using an <IFRAME> tag. This parameter causes the template script parameter to be ignored and the output is just "{results}". For better looking results, try also using the grid script parameter. See <IFRAME> in the Sample HTML section for an example. Note: If you include "iframe" in the URL, then the value 1 is implied so you can simply say: |
ssi | 0 (zero) |
Optional parameter that specifies that output is to be formatted for inclusion in an HTML page using a Server-Side-Include (SSI) statement, such as: <!--#include virtual="/cgi-bin/ae.pl?ssi&type=best&mode=books"--> Also, use this parameter for inclusion in a PHP page using a virtual() function call or a file_get_contents() function call, such as: virtual("/cgi-bin/ae.pl?ssi&type=best&mode=books"); print file_get_contents("http://www.mydomain.com/cgi-bin/ae.pl?ssi&type=best&mode=books"); Note: The PHP virtual() function uses a partial URL without a domain name, whereas the PHP file_get_contents() function uses a full URL with a domain name. |
Parameter | Default | Description (default shown in red) | ||||||
log | 0 (zero) |
If set to 1, causes the current search request to be logged in the ae-log.txt file (located in the same directory where ae.pl is located). Logging stops if log file reaches 1MB in size; delete the file to continue logging. Tip: To log only keyword search forms, add a hidden variable to your form instead: Note: To log all search request (not just the current one) then set the log configuration variable instead. Note: If you include "log" in the URL, then the value 1 is implied so you can simply say: See the log.* configuration variables for further details. |
||||||
noredirect | 0 (zero) |
Note: If you include "noredirect" in the URL, then the value 1 is implied so you can simply say: Note: The noredirect parameter no effect when the script, iframe, or ssi parameters are used since redirection is then not possible. |
||||||
virtual virtual.dir |
(empty) |
For internal use only to specify a Virtual Directory as script parameters. virtual.dir contains the initial part of the path, and virtual contains the remainder of the path. For example, for www.domain.com/amazon/type_best/mode_books then |
||||||
virtual.noredir | (empty) |
When the virtual.redir configuration variable is yes, Associate Engine automatically redirects a non-virtual URLto the equivalent virtual URL. For example, This feature can be turned off on a case-by-case basis by adding the parameter virtual.noredir to the URL, e.g.: |
Random Selection
Note: See Bug section below regarding a limitation.
Searching for random ASIN's based on a file of ASIN's is supported. Create a text file containing the ASIN's and save it in the
ae-asin directory as mylist.txt (you can use any filename, such as cookbooks.txt).There is no limit to the number of ASIN's that you can put in an ASIN list file.
On our webserver, we created a file ae-asin/mylist.txt that contains the following lines: (they are the ASIN's of 6 books about the artist Salvator Dali)
0486274543
0486282864
0821224808
3822812099
3822827401
3822872059Then do a search:
asinsearch=mylist
Searches for one random ASIN from mylist.txt file.asinsearch=mylist:3
Searches for 3 random ASIN's from mylist.txt file, preserving order of ASIN's. Use any number after the colon to specify how many ASIN's to use. To show all the ASIN's, use a large number (maximum is 30).asinsearch=mylist:-3
Searches for 3 random ASIN's from mylist.txt file, scrambling the ASIN's so the order is not preserved. Use any number after the colon to specify how many ASIN's to use. To show all the ASIN's, use a large number (maximum is 30).
Pre-Defined Searches
You could also use search.* configuration variables to pre-define searches. For example, you could define the following configuration variable:
search.artbooks "asinsearch=mylist:3&grid=c:3" The above line defines a search called artbooks as being equivalent to the search
asinsearch=mylist:3 and formatted as a 3-column grid. As indicated above, this would do a search of 3 random ASIN's from the mylist ASIN file. You could then use this pre-defined search via:
/cgi-bin/ae.pl?search=artbooks With the above definition of search.artbooks, this URL is equivalent to:
/cgi-bin/ae.pl?asinsearch=mylist:3&grid=c:3
"No results found" Error
If any of the ASIN's in a multi-ASIN request do not exist, then Amazon.com's AWS server reports an error response back to Associate Engine. In that case, AWS does not returned data for any of the ASIN's that do exist. Associate Engine therefore reports "No results found" message. Manually test each of the ASIN's until you determine which one is causing the error, e.g.: to test ASIN 1234567890, use something like:
/cgi-bin/ae.pl?asinsearch=1234567890
Timed Selection
The asinsearch parameter supports Clock Codes. Thus you could have ASIN lists week01.txt, week02.txt, ... week52.txt for each week of the year and use
asinsearch=week%W:3 to display 3 random ASIN's from the current week's file.
Bug
Currently, at most 9 ASIN's can be selected otherwise the first 10 results will be repeated. So select at most 9 results, such as:
/cgi-bin/ae.pl?asinsearch=mylist:9 For more than 9 products, use a different type of search, such as a keyword search or a browse node # search.
The PowerSearch (power search) parameter allows searching books against a variety of specific product fields such as publisher name and format (see table below for fields). Power Search is basically equivalent to amazon.com's "Power Search" search feature.
The format is:
powersearch=QUERY If necessary, you can also break the fields of the QUERY into separate parameters: (see "Seperate Parameters" section below)
powersearch.OPTION1=VALUE1&powersearch.OPTION2=VALUE2&... Note: If there are any spaces in the QUERY, then type them as either + or as %20 (the ASCII value of a space character).
Field Query VALUE Title title: VALUE
title-words-begin: VALUE
title-begins: VALUEany text Subject subject: VALUE
subject-words-begin: VALUE
subject-begins: VALUEany text Author author: VALUE
author-exact: VALUE
author-begins: VALUEany text Keyword keywords: VALUE
keywords-begin: VALUEany text ISBN asin: VALUE an ISBN number Publisher publisher: VALUE any text Language language: VALUE spanish Publication Date pubdate: VALUE before YEAR
during YEAR
after YEAR
(e.g.: during 2003)Format binding: VALUE hardcover
paperback
digital
abridged
large print
calendar
(*for audiobooks, see note below)Browse node browse: VALUE any amazon.com browse node number *Note: To search for audiobooks, use "browse:44" (audiobooks is amazon.com browse node 44). For example, "harry potter" audiobooks would be: powersearch=title:harry+potter+and+browse:44
You can use the words and, or, and not to link different queries together. You can also group queries or values together using parentheses ( and ).
Some sample queries:
- author: ambrose (note: this is equivalent to an AuthorSearch)
- author: ambrose and binding: (abridged or large print) and pubdate: after 11-1996
- subject: history and (spain or mexico) and not military and language: spanish
- (subject: marketing and author: kotler) or (publisher: harper and subject: high technology)
- keywords: high tech and not fiction and pubdate: during 1999
Separate Parameters
If necessary, you can break the fields of the QUERY into separate parameters:
powersearch.FIELD1=VALUE1 &powersearch.FIELD2=VALUE2 &...Associate Engine will "glue" the separate parameters together to internally make one PowerSearch parameter. When Associate Engine glues the parameters together, a boolean AND is put between each parameter and parentheses are added around each field/value. The internal processing is effectively:
(FIELD1: VALUE1) and(FIELD2: VALUE2) and ...Using separate parameters is useful in a situation where you want the user to select one or more field values (e.g.: keyword) and you want other field values to be set by you the webmaster. For example, the following is a form that would search for audiobooks (browse node 44) from the author that the user types in.
<FORM ACTION="/cgi-bin/ae.pl" METHOD="GET"><P>
<INPUT TYPE="HIDDEN" NAME="powersearch.browse" VALUE="44">
Author: <INPUT TYPE="TEXT" NAME="powersearch.author">
<INPUT TYPE="SUBMIT" VALUE="Search">
</P></FORM>
You can mix a powersearch parameter with powersearch.* parameters. They will all be glued together. For example, the above example could also be written as:
<FORM ACTION="/cgi-bin/ae.pl" METHOD="GET"><P>
<INPUT TYPE="HIDDEN" NAME="powersearch" VALUE="browse:44">
Author: <INPUT TYPE="TEXT" NAME="powersearch.author">
<INPUT TYPE="SUBMIT" VALUE="Search">
</P></FORM>
If necessary, you can use an expression as a parameter value. For example, the following searches for books about Spanish or Mexican history from the author that the user specifies:
<FORM ACTION="/cgi-bin/ae.pl" METHOD="GET"><P>
<INPUT TYPE="HIDDEN" NAME="powersearch"
VALUE="subject: history and (spain or mexico)">
Author: <INPUT TYPE="TEXT" NAME="powersearch.author">
<INPUT TYPE="SUBMIT" VALUE="Search">
</P></FORM>
When the user submits the above form, the PowerSearch query gets processed internally as:
(subject: history and (spain or mexico)) and (author: VALUE)
As with any form, you can use a drop-down menu to let the user pick from a list of pre-defined values. For example, the following form is similar to the above form yet the user is given the choice of whether to search for books about Spanish history, or Mexican history, or both (Spanish or Mexican history).
<FORM ACTION="/cgi-bin/ae.pl" METHOD="GET"><P>
Subject:
<SELECT NAME="powersearch.subject" SIZE="1">
<OPTION VALUE="history and spain">Spanish History</OPTION>
<OPTION VALUE="history and mexico">Mexican History</OPTION>
<OPTION VALUE="history and (spain or mexico)">both</OPTION>
</SELECT>
<BR>
Author: <INPUT TYPE="TEXT" NAME="powersearch.author">
<INPUT TYPE="SUBMIT" VALUE="Search">
</P></FORM>
< Previous | Table of Contents | Next > |
E.&O.E.; © Cusimano.Com Corporation; www.c3scripts.com