The registration script was first started in Chapter 6, “Using PHP and MySQL.” It has since been improved upon in many ways. This version of register.php will do the following:

  • Both display and handle the form

  • Validate all the submitted data using regular expressions

  • Redisplay the form with the values remembered if a problem occurs (the form will be sticky)

  • Process the submitted data using the escape_data() function from the mysql_connect.php script

  • Ensure a unique username

The Database Scheme

The database being used by this application was first created back in Chapter 4, “Introduction to SQL and MySQL,” and has been modified since then. The database consists of only one table, users, that can be re-created using the SQL command

Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide 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.