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.
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.
- Returns the Boolean value if it is a string or not. Only accept one parameter.
- Returns the Boolean value if it is an array or not. Only accept one parameter.
SiteUP! support functions:
- Check is an ID Note that it was not used as isID () due compatibility issues.
- It receives two parameters, looking for coincidence of the first in the second.
Previously, it was the validOrigin() function.
- Verify that all parameters have an assigned value.
Previously , it was the allValues() function.
Data type functions:
- Check it is a boolean value (1 or 0)
- Check is only one char length
- Check for no spaces inside
- Trim string and replace two or more spaces by one.
- Check is an integer
- Check is a real number.
- Check is a date in yyyy-mm-dd format
- Check is a date in dd-mm-yy format
Also, it is not identified as DateDMY due to compatibility issues
- Check is an hour in hh:mm:ss format
- Verify it is a date-hour data in yyyy-mm-dd hh:mm:ss format
Funciones relacionadas a internet:
- Change > y < values with > y <, 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.
- Verify is a domain (www.example.com)
- Verify is an root url for a website (http://www.example.com/)
- Verify is a root ftp url (ftp://www.example.com/)
- Verify is a valid uri (http://www.example.com/pathto/resource.file)
- Verify is an email (email@example.com).
- Verifiy is an rgb hex code
- Verify is an ip address
- Verify is a phone number in (nn) nnn-nnnn format
- Verify is an RFC (México)
- Verify is a Social security number.
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.