$Web Parm: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:$Web_Parm}} <span class="pageSubtitle"><section begin="desc" />Value of isindex or form field<section end="desc" /></span> $Web_Parm retrieves the value of an i...")
 
 
(21 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Parm}}
{{DISPLAYTITLE:$Web_Parm}}
<span class="pageSubtitle"><section begin="desc" />Value of isindex or form field<section end="desc" /></span>
<span class="pageSubtitle">Value of isindex or form field</span>


<var>$Web_Parm</var> retrieves the value of an isindex or form field in a request.


<var>$Web_Parm</var> takes four arguments and returns a string, or null for any error condition.


$Web_Parm retrieves the value of an isindex or form field in a request.
==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %STRING = $Web_Parm( fieldname, occurrence, start, length )
<p class="syntax"><span class="term">%string</span> = <span class="literal">$Web_Parm</span>( <span class="term">fieldname</span>, <span class="term">occurrence</span>, [<span class="term">start</span>], [<span class="term">length</span>] )
<section end="syntax" /></p>
</p>
 


$Web_Parm takes four arguments and returns a string, or null for any error condition.
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>fieldname</th>
<tr><th>fieldname</th>
<td>The name of the isindex or form field, returned by $Web_Name. Required argument if occurrence not specified, otherwise optional.</td></tr>
<td>The name of the isindex or form field, returned by <var>[[$Web_Name]]</var>. Required argument if occurrence not specified, otherwise optional.</td></tr>
<tr><th>occurrence</th>
<tr><th>occurrence</th>
<td>The occurrence number of an isindex or form field, or the occurrence number of the isindex or form field matching 'fieldname', if fieldname is specified. Optional argument if fieldname is specified, otherwise it is required.</td></tr>
<td>The occurrence number of an isindex or form field, or the occurrence number of the isindex or form field matching <var class="term">fieldname</var>, if <var class="term">fieldname</var> is specified. Optional argument if <var class="term">fieldname</var> is specified, otherwise it is required.</td></tr>
<tr><th>start</th>
<tr><th>start</th>
<td>Starting position within the field. Optional argument which defaults to 1.</td></tr>
<td>Starting position within the field. Optional argument which defaults to 1.</td></tr>
<tr><th>length</th>
<tr><th>length</th>
<td>Length to return. This is an optional argument, provided in case an isindex or form field exceeds 255 bytes. The length of an isindex or form field can be determined with $Web_Len. The default is the length of the isindex or form field.
<td>Length to return. This is an optional argument, provided in case an isindex or form field exceeds 255 bytes. The length of an isindex or form field can be determined with <var>[[$Web_Len]]</var>. The default is the length of the isindex or form field.
</td></tr></table>
</td></tr></table>


==Usage notes==
<ul>
<li><var>$Web_Parm</var> first looks for isindex fields matching the name, then for matching form fields. <var>$Web_Parm</var> can be used instead of <var>$Web_IsIndex_Parm</var> and <var>$Web_Form_Parm</var> to make it easy to switch between using "method=GET" and "method=POST"<form> tags and simply to save typing.
</ul>


 
==Examples==
This example places the value of each isindex or form field in a URL into a User Language %variable of the same name.
This example places the value of each isindex or form field in a URL into a <var class="product">User Language</var> %variable of the same name.
<p class="code"> * Stash the form values in matching fields.
<p class="code">&#42; Stash the form values in matching fields.
   
   
%CUSTOMER_NAME = $Web_Parm( 'CUSTOMER_NAME' )
%CUSTOMER_NAME = $Web_Parm( 'CUSTOMER_NAME' )
%CUSTOMER_NUM = $Web_Parm( 'CUSTOMER_NUM' )
%CUSTOMER_NUM = $Web_Parm( 'CUSTOMER_NUM' )
%ORDER_NUM = $Web_Parm( 'ORDER_NUM' )
%ORDER_NUM = $Web_Parm( 'ORDER_NUM' )
%ORDER_DATE = $Web_Parm( 'ORDER_DATE' )
%ORDER_DATE = $Web_Parm( 'ORDER_DATE' )
%ORDER_ITEM = $Web_Parm( 'ORDER_ITEM')
%ORDER_ITEM = $Web_Parm( 'ORDER_ITEM')
%ORDER_ITEM2 = $Web_Parm( 'ORDER_ITEM', 2)
%ORDER_ITEM2 = $Web_Parm( 'ORDER_ITEM', 2)
</p>
</p>


 
==See also==
$Web_Parm first looks for isindex fields matching the name, then for matching form fields. $Web_Parm can be used instead of $Web_IsIndex_Parm and $Web_Form_Parm to make it easy to switch between using "method=GET" and "method=POST"<form> tags and simply to save typing.
 
See also:
<ul>
<ul>
 
<li><var>[[$Web_Parm_Len]]</var>
<li>[[$Web_Parm_Len]]  
<li><var>[[$Web_Name]]</var>
<li>[[$Web_Name]]  
<li><var>[[$Web_Num]]</var>
<li>[[$Web_Num]]  
<li><var>[[$Web_Form_Parm]]</var>
<li>[[$Web_Form_Parm]]  
<li><var>[[$Web_IsIndex_Parm]]</var>
<li>[[$Web_IsIndex_Parm]]  
<li><var>[[$Web_Parm_Lstr]]</var>
<li>[[$Web_Parm_Lstr]]
</ul>
</ul>




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

Latest revision as of 02:33, 16 April 2013

Value of isindex or form field

$Web_Parm retrieves the value of an isindex or form field in a request.

$Web_Parm takes four arguments and returns a string, or null for any error condition.

Syntax

%string = $Web_Parm( fieldname, occurrence, [start], [length] )

Syntax terms

fieldname The name of the isindex or form field, returned by $Web_Name. Required argument if occurrence not specified, otherwise optional.
occurrence The occurrence number of an isindex or form field, or the occurrence number of the isindex or form field matching fieldname, if fieldname is specified. Optional argument if fieldname is specified, otherwise it is required.
start Starting position within the field. Optional argument which defaults to 1.
length Length to return. This is an optional argument, provided in case an isindex or form field exceeds 255 bytes. The length of an isindex or form field can be determined with $Web_Len. The default is the length of the isindex or form field.

Usage notes

  • $Web_Parm first looks for isindex fields matching the name, then for matching form fields. $Web_Parm can be used instead of $Web_IsIndex_Parm and $Web_Form_Parm to make it easy to switch between using "method=GET" and "method=POST"<form> tags and simply to save typing.

Examples

This example places the value of each isindex or form field in a URL into a User Language %variable of the same name.

* Stash the form values in matching fields. %CUSTOMER_NAME = $Web_Parm( 'CUSTOMER_NAME' ) %CUSTOMER_NUM = $Web_Parm( 'CUSTOMER_NUM' ) %ORDER_NUM = $Web_Parm( 'ORDER_NUM' ) %ORDER_DATE = $Web_Parm( 'ORDER_DATE' ) %ORDER_ITEM = $Web_Parm( 'ORDER_ITEM') %ORDER_ITEM2 = $Web_Parm( 'ORDER_ITEM', 2)

See also