4. adding records

In the first chapter we created the database structure for this employee listing Web site. In the previous two chapters, we developed an Ajax as well as a non-Ajax approach for browsing the employees by department. In this chapter, let’s create a way to add employees to the database. Naturally we’ll start with the non-Ajax version, for universal accessiblity, and then add the Ajax-enabled version in the next chapter.

To begin, we’ll start by creating the HTML form that takes all the requisite data. Then we’ll write the PHP script that handles the form submission in a non-Ajax way. This will all be fairly basic PHP form handling.

what we’ll do

First, on pages 45-48, we’ll create an HTML page with a form.

Naturally, we’ll ...

Get Building a Web Site with Ajax: Visual QuickProject 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.