Assignment #4 - Database
Due Date: November 9, 2003
Value: 15 points
Part 1 (12 pts)
Send the instructor an e-mail with the URL for the assignment. email@example.com.
The following takes similar elements we had in assignment 3 and expands them to use a database instead of files. You might want to look over my examples for assignment 2 for help in streamlining your code.
I will be e-mailing to the class information regarding the accounts, database names to be used, and passwords for the course databases.
- Create at least this table in your database:
- Membership (ID [int not null primary key auto_increment], First Name [varchar 75], Last Name [varchar 75], Address [varchar 75], City [varchar 75], State [varchar 75], Zip [varchar 75], Phone [varchar 75], Email [varchar 75], Password [varchar 75], Admin [int])
The membership table is made up of a series of fields. These fields have to be defined. The definitions are contained with the  for each field name. Such that the ID field is a integer and is automatically assigned each time you create a new field and it is unique. The other fields are all variable character of up to 75 characters. Page 323, Lising 16.4, gives an example of creating this table with PHP code. You will write a program that generates this table the first time. If you need to, you might want to download the trial version of Navicat (http://www.navicat.com/) that will allow you to examine your database and make edits as you work on your code.
- Addtional tables as needed.
- Implement the following basic pages
- Entry Page
Like Assignment 3. This page will be your front page of whatever organization you are creating.
- New Member Page
Allow the user to enter all the information above for a new entry. Validate as needed so that you have good data in your membership record. Follow the process of creating a new member as discussed in assignment 3. That is, try to avoid duplicate memberships records.
- Password Help
If a user has forgotten their password that can request the password. Ask the user to enter their e-mail address, check to see if it exists in the database, and if so then send an e-mail to that address with the password information. This is different from assignment 3.
NOTE: The server is configured to only be able to send e-mails to on campus addresses. Keep that in mind when entering e-mail addresses to test against.
- Membership Information / Edit
Display the members record when requested. The user has to have logged in. If they haven't run them though the login process. Add the ability for a user to Edit their Membership information and save it back to the database.
- Admin Page
A user with Admin capability (as indictaed in the membership table - use the Admin field) can do the following things on this page 1) delete any user (probably need some type of drop down or other method to select users in the database), 2) edit any user (same selection issue), 3) if editing a user as admin, an admin has the capability to turn on or off admin capability to that user (additional field that only someone with admin will see), and 3) can send an e-mail to all users in the database (see chapter 17 for some examples).
- Simple Discussion Forum
Using code from Chapter 19, integrate the simple discussion forum into this assignment, such that 1) a user has to be logged into to access the forums, 2) since they are logged in you can supply e-mail, name, etc and don't have to have them type it in again, 3) that a user with admin ability can delete a message. Note: The code for this part is included on the CD that came with the book.
Part 2 (3 pts)
- Locate and read, from any professional journal, two articles relevant to the area of Security for PHP and Databases. Write a two paragraph review for each article. The 1st paragraph should describe the contents of the article. The 2nd paragraph should be your reaction to the article. Do not forget to include the reference cite. Use APA format.
- Reply to at least three postings in a meaningful manner. Be sure to include
your name in the subject line like: Re: There Name - Assignment #3 - Your Name