$Web Num IsIndex: Difference between revisions
(Automatically generated page update) |
mNo edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 9: | Line 9: | ||
==Syntax== | ==Syntax== | ||
<p class="syntax"><span class="term">%count</span> = <span class="literal">$Web_Num_IsIndex</span>( fieldname ) | <p class="syntax"><span class="term">%count</span> = <span class="literal">$Web_Num_IsIndex</span>( [<span class="term">fieldname</span>] ) | ||
</p> | </p> | ||
Line 20: | Line 20: | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li> | <li>An application written to handle isindex fields generically would need to determine the number of isindex fields in a URL before finding the names of the fields. | ||
An application written to handle isindex fields generically would need to determine the number of isindex fields in a URL before finding the names of the fields. | |||
<p class="code">%I_COUNT = $Web_Num_IsIndex | <p class="code">%I_COUNT = $Web_Num_IsIndex | ||
IF %I_COUNT EQ 7 THEN | IF %I_COUNT EQ 7 THEN | ||
Line 31: | Line 30: | ||
This is sample code from an application that sends a slightly different form (that is processed with a "method=GET") to Netscape browser users than it does to other browsers. <var>$Web_Num_IsIndex</var> is used to detect the number of fields on the form, and to route processing accordingly. This example uses the fact that for some reason the number of isindex fields returned will by 7 for Netscape clients but some other number for other browsers. To more precisely determine what browser the client is using, use "$WEB_HDR_PARM('USER-AGENT')". | This is sample code from an application that sends a slightly different form (that is processed with a "method=GET") to Netscape browser users than it does to other browsers. <var>$Web_Num_IsIndex</var> is used to detect the number of fields on the form, and to route processing accordingly. This example uses the fact that for some reason the number of isindex fields returned will by 7 for Netscape clients but some other number for other browsers. To more precisely determine what browser the client is using, use "$WEB_HDR_PARM('USER-AGENT')". | ||
<li>For a discussion of isindex requests and data, see [[Janus Web Server application coding considerations#URL parameters or isindex data|"URL parameters or isindex data"]]. | <li>For a discussion of isindex requests and data, see [[Janus Web Server application coding considerations#URL parameters or isindex data|"URL parameters or isindex data"]]. | ||
</ul> | </ul> |
Latest revision as of 01:01, 16 April 2013
Number of isindex fields
$Web_Num_IsIndex retrieves the number of isindex fields in a URL.
Since isindex fields are more commonly called "URL parameters,", you may want to use the synonym for this $function, $Web_Num_URL_Parm.
$Web_Num_IsIndex takes a single optional argument and returns a number.
Syntax
%count = $Web_Num_IsIndex( [fieldname] )
Syntax terms
fieldname | Specifies to count only the isindex fields that match fieldname. If omitted, returns the count of all isindex fields. |
---|
Usage notes
- An application written to handle isindex fields generically would need to determine the number of isindex fields in a URL before finding the names of the fields.
%I_COUNT = $Web_Num_IsIndex IF %I_COUNT EQ 7 THEN JUMP TO PROCESS_NETSCAPE ELSE JUMP TO PROCESS_OTHER_BROWSERS END IF
This is sample code from an application that sends a slightly different form (that is processed with a "method=GET") to Netscape browser users than it does to other browsers. $Web_Num_IsIndex is used to detect the number of fields on the form, and to route processing accordingly. This example uses the fact that for some reason the number of isindex fields returned will by 7 for Netscape clients but some other number for other browsers. To more precisely determine what browser the client is using, use "$WEB_HDR_PARM('USER-AGENT')".
- For a discussion of isindex requests and data, see "URL parameters or isindex data".