PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
obtain form variable
mixed pnVarCleanFromInput(name, ...);
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.
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.
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.
// Obtain a single value
$id = pnVarCleanFromInput('id');
// Obtain a number of values
list($name, $number) = pnVarCleanFromInput('name', 'number');
Previous |
Next |