O'Reilly logo

Sams Teach Yourself CGI in 24 Hours, Second Edition by Rafe Colburn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Validating Values

It’s not enough to know which technique should be used to process form input; you also need to know what sorts of things you can validate in form fields. In the sample script, I checked to make sure that the user entered something in each of the fields. That sort of check is better than nothing, but it doesn’t really do much to ensure that the user entered the type of data that you expected in the field.

In some cases, validation beyond making sure that the field is populated is unnecessary. For example, if you’re just letting users enter feedback about the Web site, it’s not so important what they enter in the form field for comments. Or, such a wide variety of values is allowed that there’s no reliable way to make sure that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required