PostNuke Help |
||
|---|---|---|
Previous |
Next |
|
validate a variable
bool pnVarValidate(var, type, args);
pnVarValidate() returns true if the validation was successful, false if not
The variable to validate
The type of validation to perform either email or url
An optional Array of arguments
This function currently returns true on successful validation, and false if validation was unsuccessful.
args is unimplemented currently.
// 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 |