HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: Validation

» Return to Contents



Validation is one of the most important things in the battle against hackers, so ocPortal provides a full compliment of validation functions (most of them aren't in validation.php, though).
The functions in validation.php (shown here) are concerned with specific validations of input, rather than simple type checks.

sources/type_validation.php

Global_functions_type_validation.php

Function summary

boolean is_alphanumeric (string string)
boolean is_valid_email_address (string string)

boolean is_alphanumeric(string string)

Find whether the specified string is alphanumeric or not.

Parameters…

Name string
Description The string to test
Type string

Returns…

Description Whether the string is alphanumeric or not
Type boolean

Return to the function index for this class Expand: View the source code to this function

boolean is_valid_email_address(string string)

Find whether the specified address is a valid e-mail address or not.

Parameters…

Name string
Description The string to test (Note: This is typed string, not e-mail, because it has to function on failure + we could make an infinite loop)
Type string

Returns…

Description Whether the string is an email address or not
Type boolean

Return to the function index for this class Expand: View the source code to this function