Assignment 3
Database Interactivity: User Registration Form
The purpose of this assignment is to interact with a MySQL database through a
PHP page. You will create a form that accepts user registrations, checks for a
valid email, and emails the user a pre-written email welcoming them to the Spam
Newsletter.
- In a new folder labeled assign3, create a form that accepts a user's first
and last name, username, password, and email address.
- Create a database and table to accept user registrations from the form;
include a user_id field as a primary key, as well as a registration date
field.
- Using the sample code from class and from Chapter 6 in the text, have the
form interact with the database by inserting a record into a table. The page
should only accept valid email addresses (from last week's code), and should
email a confirmation welcoming the user to the spam newsletter they've signed
up for.
- Create a page that lists all registered users by querying the database.
Save the page, upload it to the server, and link to it from your main page.
Options: Check to see if a username exists before inserting to the database,
and ask the user to try a different username if so.
©2005 - Bryson R. Payne, Ph.D. - All
rights reserved.