Class InputParam

(line 385)

Description


Located in File: /system.inc.php

Represents an input parameter from the user, it doesn't inherit from Object to be faster and smaller.

Objects of this type are returned from the Input object and you must use any of the available methods like asString() to get the value filtered properly.



Classes extended from InputParam:
RawInputParam
This class represents an input param with no filtering at all.

Properties

Summary:

[none]

Methods

Summary:
__construct Create the object
asBoolean Returns the input filtered as a boolean
asEmail Returns the input filtered as an email address
asEncoded URL-encode string, optionally strip or encode special characters.
asFloat Returns the input filtered as a float
asInteger Returns the input filtered as a integer
asIP Returns the input filtered as an IP address
asRegExp Returns the input filtered as a regular expression
asSpecialChars HTML-escape '"<>& and characters with ASCII value less than 32, optionally strip or encode other special characters.
asString Returns the input filtered as a string
asStringArray Returns the input filtered as a string array
asStripped Returns the input filtered as an string
asUnsafeRaw Do nothing with the input
asURL Returns the input filtered as an URL
createNativeFilter Creates the native Input Filter to be used when there is no available extension

Constructor __construct (line 397)

InputParam __construct( $name $name, [$stream $stream = SGET])

Create the object

Parameters

  • $name $name: Key of the stream to look form
  • $stream $stream: Stream to look for

Method asBoolean (line 514)

boolean asBoolean( )

Returns the input filtered as a boolean

Use this property to get the value from the input as a boolean value. The input is validated and if it's not a boolean, an empty string is returned.


Method asEmail (line 609)

string asEmail( )

Returns the input filtered as an email address

Use this property to get the value from the input as an email. The input is sanitized to remove anything that might not be part of an email.


Method asEncoded (line 679)

string asEncoded( )

URL-encode string, optionally strip or encode special characters.

Use this property to get the value from the input as an encoded URL. The input is sanitized to remove anything that might not be part of an encoded url.


Method asFloat (line 539)

float asFloat( [integer $flags = 0])

Returns the input filtered as a float

Use this property to get the value from the input as a float value. The input is sanitized to remove anything that might not be part of a float number.

Parameters

  • integer $flags: Flags to be sent when getting the value asfloat

Method asInteger (line 491)

integer asInteger( )

Returns the input filtered as a integer

Method asIP (line 632)

string asIP( )

Returns the input filtered as an IP address

Use this property to get the value from the input as an IP number. The input is validated to see if it's a valid IP and if not, an empty string is returned.


Method asRegExp (line 562)

string asRegExp( )

Returns the input filtered as a regular expression

Use this property to get the value from the input as a float value. The input is validated and if it's not a regular expression, an empty string is returned.


Method asSpecialChars (line 699)

string asSpecialChars( )

HTML-escape '"<>& and characters with ASCII value less than 32, optionally strip or encode other special characters.

Method asString (line 442)

string asString( )

Returns the input filtered as a string

Use this property to get the value from the input as a string value. The input is sanitized to strip out dangerous content.


Method asStringArray (line 465)

array asStringArray( )

Returns the input filtered as a string array

Use this property to get the value from the input as a string array. The input is sanitized to strip out dangerous content.


Method asStripped (line 656)

string asStripped( )

Returns the input filtered as an string

Use this property to get the value from the input as string. The input is sanitized to remove anything that may cause a security issue.


Method asUnsafeRaw (line 721)

string asUnsafeRaw( )

Do nothing with the input

Use it to get the input as-is, use it when you know, for sure, the input is safe.


Method asURL (line 586)

string asURL( )

Returns the input filtered as an URL

Use this property to get the value from the input as an URL. The input is sanitized to remove anything that might not be part of a URL.


Method createNativeFilter (line 427)

void createNativeFilter( )

Creates the native Input Filter to be used when there is no available extension

Events

Summary:

[none]

Javascript Events

Summary:

[none]

Documentation generated on Fri, 26 Dec 2008 11:46:47 +0100 by phpDocumentor 1.4.0a2