Google


ADBRITE ads links
You are here: CodeIdol.com > Php > PHP 5 in Practice > Data Validation And Standardization

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

PHP 5 in Practice



11. Data Validation and Standardization With any type of general user input, such as that retrieved through form submissions, the programmer must always expect the worse, even if you do not consider malicious intent. Hence, you are always fa...



11.1. Phone Numbers The phone numbers that this example deals with are those in the standard notation used in the United States: A phone number consists of a three-digit area code, followed by a three-digit exchange code, and then a four-digit num...

read more: Phone Numbers


11.2. ZIP Codes The format of ZIP Codes in the United States is straightforword and easy to standardize and validate against: five digits followed optionally by a dash and four more digits. Though the format is easily dealt with, the problem of va...

read more: ZIP Codes


11.3. Social Security Numbers (SSNs) In the United States, everyone is issued a Social Security Number (SSN), which ends up being used as your unique identifier in many circumstances; therefore, it is often requested of people on forms. It alway...



11.4. Numbers When dealing with numbers, such as monetary amounts, no generic validation really can be done. Instead you need to check the number entered against the range of numbers that is valid for that specific input. We can, however, create a...

read more: Numbers


11.5. Credit Card Numbers If dealing with any sort of commerce website, you will need to take credit card numbers. Credit card companies have built a verification system into the card numbers, which makes the verification process possible. After s...



11.6. Dates Because PHP provides a number of excellent date tools, very little work is needed to standardize or validate dates. In particular, the strtotime() function converts most string representations of dates into UNIX timestamps. If it fai...

read more: Dates


11.7. Email Accounts Email accounts follow a set pattern of what is allowed. An email address must start with a character, number, underscore, or dash. It can then have any number of those characters plus periods. An "at" sign (@) follow...

read more: Email Accounts


11.8. URLs If you have a web form where you are asking users for their home site, it might be worthwhile to do a quick validation of this URL just to determine whether it appears to be valid. There are really two levels of checking the validity of...

read more: URLs

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

You are here: CodeIdol.com > Php > PHP 5 in Practice > Data Validation And Standardization
   
Related tags







Popular Categories
Unix books and guides
AJAX popular information
C# language guides
Windows books and cookbooks
.......



I'll tell you how to win big during one night, use the roulette games tips, and betting systems.. Visit the casino slots once, and the search of the champion pots will no longer be your trouble.. Visit the dice online once, and the search of the first pots will no longer be your trouble.


© CodeIdol Labs, 2007