PostNuke Help

Previous
pnVarCensor

Home
up

Next
pnVarPrepForDisplay


pnVarCleanFromInput

obtain form variable

Synopsis

mixed pnVarCleanFromInput(name, ...);

Description

pnVarCleanFromInput() takes a variable number of name arguments and for each one obtains the variable from the input namespace. It removes any preparsing done by PHP to ensure that the string is exactly as expected, without any escaped characters.

pnVarCleanFromInput() also removes any HTML tags that could be considered dangerous to the PostNuke system's security.

Return Values

If pnVarCleanFromInput() is only passed a single name argument then it returns the corresponding variable. If pnVarCleanFromInput() is passed multiple arguments then it returns an array of corresponding variables.

Notes

Obtaining input variables from the global namespace, or from arrays such as HTTP_POST_VARS, is not supported and should never be done. pnVarCleanFromInput() is the only supported way of obtaining such variables.

Examples

// Obtain a single value
$id = pnVarCleanFromInput('id');
// Obtain a number of values
list($name, $number) = pnVarCleanFromInput('name', 'number');
       

Previous
pnVarCensor

Home
up

Next
pnVarPrepForDisplay