Chapter 10Validation

When web sites contain forms that allow users to enter their own data, there is always the risk that improper data will be entered. Whether this improper data is accidental or intentional, steps should be taken to ensure that the data entered is what is expected. One of the most common issues is that the user has not entered any data at all. Other potential problems are users entering letters where numbers should be or entering invalid email addresses. Let’s take a look at a few examples using the form.php and form_response.php pages from Chapter 9.

1. Open form.php in your web editor. We will need to add a few more input lines to adequately test validation scenarios.

2. At the bottom of the form before the submit line, add ...

Get FileMaker Web Publishing: A Complete Guide to Using the API for PHP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.