Responsive web Framework

DOCUMENTATION

Validate

Their use can be either to validate information or to establish a unified format for the fields

NOT AVAILABLE FOR TINY SCREENS

(minimum width: 480px)

Purpose

This tool has a double function. Firstly, to validate that the information meets the criteria of the type of information it must contain and, on the other hand, to modify the value to meet a certain standard.

By criteria of compatibility and ease of use, the name of the functions only carries a capitalized word.

Descripción

Although it is designed to run independently, it contains some system functionality. It is organized into groups of functions according to the nature of the data to be received.
For the most part, the functions are given as a parameter an array of variables or a single value that is modified and returned corrected. That is, they meet the following operating criteria: $x = "value"; $y = functionY($x); At the end of the process, $x and $y has the same value.

Auxiliary funcitons:

isString(x)
Returns the Boolean value if it is a string or not. Only accept one parameter.
isArray(x)
Returns the Boolean value if it is an array or not. Only accept one parameter.

SiteUP! support functions:

isId(x)
Check is an ID Note that it was not used as isID () due compatibility issues.
isSubstr(x)
It receives two parameters, looking for coincidence of the first in the second. Previously, it was the validOrigin() function.
isAlltrue(x)
Verify that all parameters have an assigned value. Previously , it was the allValues() function.

Data type functions:

isBool(x)
Check it is a boolean value (1 or 0)
isChar(x)
Check is only one char length
isWord(x)
Check for no spaces inside
isCollapsed(x)
Trim string and replace two or more spaces by one.
isInt(x)
Check is an integer
isReal(x)
Check is a real number.
isDate(x)
Check is a date in yyyy-mm-dd format
isDatedmy(x)
Check is a date in dd-mm-yy format Also, it is not identified as DateDMY due to compatibility issues
isTime(x)
Check is an hour in hh:mm:ss format
isDtime(x)
Verify it is a date-hour data in yyyy-mm-dd hh:mm:ss format

Funciones relacionadas a internet:

isText(x)
Change > y < values with &gt; y &lt;, also adds a backslash at the end of ' and "e;. Do not confuse the use of this function with the method dbClrQuotes of the DbConnection object, or the use of escape() and encode() functions.
isDomain(x)
Verify is a domain (www.example.com)
isWebsite(x)
Verify is an root url for a website (http://www.example.com/)
isFtpsite(x)
Verify is a root ftp url (ftp://www.example.com/)
isUrl(x)
Verify is a valid uri (http://www.example.com/pathto/resource.file)
isEmail(x)
Verify is an email (something@example.com).
isHexcolor(x)
Verifiy is an rgb hex code
isIp(x)
Verify is an ip address

Other functions:

isPhone(x)
Verify is a phone number in (nn) nnn-nnnn format
isRfc(x)
Verify is an RFC (México)
isSocialsecurity(x)
Verify is a Social security number.

Use

These functions are used in two parts. In the forms (js) in order to validate the entered parameters; as well as in cgis (pl) in order to verify the validity of the data received. This double checking is necessary in order to prevent erroneous data by code injection or alteration of parameters via GET.

In the case of the SiteUP! System, fields in forms containing the validate class are validated according to the value contained in data-valid , for later modification or acquisition xlass .error if it does not meet the standard.

See it! icon execute code