$Web Num IsIndex: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 34: Line 34:
<ul>
<ul>


<li>[[$Web_IsIndex_Parm_Len]]  
<li>[[<var>$Web_IsIndex_Parm_Len]]</var>
<li>[[$Web_IsIndex_Name]]  
<li>[[<var>$Web_IsIndex_Name]]</var>
<li>[[$Web_IsIndex_Parm]]
<li>[[<var>$Web_IsIndex_Parm]]</var>
</ul>
</ul>
For a discussion of isindex requests and data, see .
For a discussion of isindex requests and data, see .


[[Category:Janus Web Server $functions|$Web_Num_IsIndex]]
[[Category:Janus Web Server $functions|$Web_Num_IsIndex]]

Revision as of 20:17, 12 June 2012

<section begin="desc" />Number of isindex fields<section end="desc" />


$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.

Syntax

<section begin="syntax" /> %COUNT = $Web_Num_IsIndex( fieldname ) <section end="syntax" />


$Web_Num_IsIndex takes a single optional argument and returns a number.

fieldname Specifies to count only the isindex fields that match fieldname. If omitted, returns the count of all isindex 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.

%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')".

See also:

  • [[$Web_IsIndex_Parm_Len]]
  • [[$Web_IsIndex_Name]]
  • [[$Web_IsIndex_Parm]]

For a discussion of isindex requests and data, see .