Validating form data

It allows you to specify required characters, optional characters, literal characters, such as hyphens and parentheses, currency characters, and date separators.The control also works well when bound to a data source.

validating form data-13

If the information the user enters is tainted, you could have a major problem on your hands. Mistakes can happen, either on purpose or by accident, that could reveal flaws in your code, cause the loss of data, or bring your entire system to a crashing halt.

Some good validation techniques are: When to Use Regular Expressions I often see what I would call an overuse of regular expressions.

Validation can be defined by many different methods, and deployed in many different ways.

Server side validation is performed by a web server, after input has been sent to the server.

Handling form data is still far and away the most common use of PHP (in this author's humble opinion, anyway).

The security concern lies in the fact that the PHP page handling the form will do something with the information the user enters: store it in a database, pass it along to another page, or use it in an email.

As a guide, regular expressions the most exacting security measure, but they're almost definitely the least efficient and possibly the most problematic.

I'm not suggesting you shouldn't use them—just make sure they're really the best option for the data being validated.

When you finish this course, you will be fully equipped to build your very own custom web apps with Flash.

Tags: , ,