RPGspIn Function


Receives browser input such as session variables, cookies, environment variables, query string parameters, or form entries. The information is returned as a character string.


Syntax

RPGspIn(name [: input type])

Part Description
name Required. Character expression representing the name of a session variable, cookie, environment variable, query string parameter, or form field.
input type

Optional. Character expression containing one of the following:

  • 'Cookie' - indicates a cookie
  • 'SessionVar' - indicates a session variable
  • 'Env' - indicates an environment variable
  • 'Input' - indicates a form field or a query string parameter

The expression is not case sensitive. If omitted, the first available input is retrieved, with priority given to Form fields and Query string parameters, then Cookies and Session variables, then Environment variables.


Remarks

The function returns a character data type because the browser handles everything as character strings. When working with numerics, use the RPGspVal function to convert the returned values to a numeric data type.

The values saved with RPGspCookie or RPGspSave are not actually saved until the page has executed entirely. These functions are used to pass information to subsequent calls to the same page or to other pages. Thus, RPGspIn cannot retrieve these values during the same page load. The saved values can only be retrieved when the page reloads or from another page.


Examples

The following displays the referring page by using the 'HTTP_REFERER' environment variable:

<% RPGspIn('HTTP_REFERER') %>


A more specific way accomplish this would be as follows:

<% RPGspIn('HTTP_REFERER':'Env') %>

We explicitly specified the input type.


Here is another example where we retrieve a form entry called 'QTY' and assign it to an RPG variable.

     C                   Eval      QTY = RPGspVal(RPGspIn('QTY':'Input'))  

The value must be converted to a numeric type with the use of RPGspVal.


See Also

RPGspCookie

RPGspInUpper

RPGspInVal

RPGspOut

RPGspSave

RPGspVal


Profound Logic Software, Inc.
www.ProfoundLogic.com
(937) 439-7925