Project 2: XHTML/PHP/Database System
Description and Requirements
For this project, you will be building a functional system of an XHTML form, PHP scripts, and dynamic URLs to enter and retrieve data from a MySQL database. In essence, it is a basic content management system for your data set.
First, you will construct a database and tables that fits your dataset. This should include at least two tables: one for information shared across multiple records, and another for the unique records themselves. For example, if we were building a database for tracking patient visits to a doctor's office, we'd want one table with the patients' names and addresses, and another with their individual visits. That way, if a patient changed her address, it would only have to be updated in one record, rather than as many records as she had visits to the doctors office. And in the future, it would be easy to build yet another table for handling billing information--and again refer to the central table listing patient names and addresses.
Then, you will build an XHTML page listing all of your records in the database. Each record will have a link to an XHTML form for entering, retrieving, and editing information in the database. You'll be building PHP scripts necessary for this. So at minimum, you will create three different files:
- list.php - PHP output of list of records in the database
- form.php - PHP-driven XHTML form for entering new records, or viewing and modifying records
- post.php - PHP-driven script for handling information from the XHTML form and getting it into the database
Finally, you will use Apache
mod_rewrite to make "clean" URLs and do basic data checking for retrieving records from your database, e.g.,
http://localhost/record/1745 in place of query-string URLs like
http://localhost/form.php?id=1745.
Deliverables
- On your USB drive w/ XAMPP:
- A MySQL database with at least one, possibly two tables, with unique ids
- An XHTML page listing items in the database
- XHTML form for entering and retrieving/editing items from your database
- A PHP script to pass form information to the database
- Dynamic URLs using mod_rewrite to select records from the database
- PHP scripts using dynamic URL variables to pull information from the database into the form
- The system MUST function for this project to be considered complete
- On the wiki:
- A one-page memo describing:
- the audience/users, context, and content of your database system
- how your system could grow and be improved in the future to better meet the needs of its users, context, and content
- an evaluation of your work and progress in the class to this point.
- The code for each of your 3 scripts (list, form, and post)
- Wiki table markup showing your table structures
Presentations
You will do an approximately 10-minute presentation about your database system; focus on talking about the
audience/users,
context, and
content of your system.
Everyone else will ask you lots of tough questions, as will the instructor.
Project Due Date: Thursday, November 6.
Turn-In Instructions
Because I don't want you to have to part with your USB drives, here are instructions for sending me your projects, which I will then recreate and test on my own drive.
Preparing your scripts:
- Name your project folder something unique; many of you are still using "contacts" from the example scripts.
- If you are using projecttwo or something like that for your folder name, rename it with your initials, e.g., kas-projecttwo.
- Double-check your URLs in your scripts, particularly the listing on index.php, the action attribute on your forms, and the link from post.php that takes you back to index.php.
- Test your project again, just to make sure that it works.
- Then, log into phpMyAdmin so that you can export your database.
Exporting the database:
- Once you have logged in, choose the Export link toward the bottom of the phpMyAdmin home page
- On the export page, choose the following Settings:
- Export: Select ONLY your database from Project 2; make sure SQL is also selected
- Options: Leave everything as is by default; change "Maximal length of created query" to 0 (which means unlimited).
- Save as file: Make sure Save as file is checked; in file name template, replace SERVER with your first and last name separated by a hyphen, e.g., jane-smith
- Click Go; it will (or should) prompt you to save your-name.sql. Save the .sql file in the folder you (re)named for project 2.
Zipping it all up:
- Go to your folder in XAMPP, and check once more that all of your scripts AND your .sql file are there.
- Go up one level, so you're just seeing the folder icon for your project folder. Right-click the folder icon, and choose Send To > Compressed (zipped) Folder.
- Doing that should create a .zip file of the same name.
- Send an email to karl.stolley@gmail.com and attach the .zip file.
There are no comments on this page. [Add comment]