PostNuke Help

Previous
pnVarPrepHTMLDisplay

Home
up

Next
PostNuke Module Developer's Guide


pnVarValidate

validate a variable

Synopsis

bool pnVarValidate(var, type, args);

Description

pnVarValidate() returns true if the validation was successful, false if not

Parameters

var

The variable to validate

type

The type of validation to perform either email or url

args

An optional Array of arguments

Return Values

This function currently returns true on successful validation, and false if validation was unsuccessful.

Notes

args is unimplemented currently.

Examples

// validate email address
if (!pnVarValidate('john.doe@example.com', 'email')) {
    die('email address is incorrect format');
}
// validate url
if(!pnVarValidate('http://www.example.com','url')) {
    die('URL is invalid');
}


Previous
pnVarPrepHTMLDisplay

Home
up