PHP Insertion

Introduction

The goal of this week's in-lab is to create a set of php pages that enable the user to insert new information into the COUNTRY table that was first introduced in lecture on 23.05.

Objectives

dataEntry.php

The user should be provided with a form with four (initially empty) data entry fields: country, id, primary language and population. The bottom of the form should contain both a "reset" button and a "submit" button. Clicking the "reset" button should clear the form and clicking the "submit" button should take the user to the page verify.php.

verify.php

This page should verify that (1) country is a string consisting of the following characters: a-z, A-Z, and spaces (" "), (2) id is a positive integer, (3) primary language is a string consisting of a-z, A-Z and spaces, (4) population is an integer greater than or equal to 0 and (5) id does not already occur in the COUNTRY table since it is the primary key. If everything is OK, the new information should be inserted into the COUNTRY table and the user should be automatically redirected to the page display.php. Otherwise, the user should be automatically redirected back to the page dataEntry.php. To make this problem simpler, the dataEntry.php does not need to identify the specific error and it can start with all blank fields. However, if you wish to display specific error messages and the previously entered values, you are welcome to do so.

display.php

This page should print out the entire contents of the COUNTRY table in an HTML table environment. The page should be identical to the update2.php file that was covered in lecture today.

Valid XHTML 1.0!