PHP Exercise
In this exercise you will be creating a
table to store information about music you own and a web page to display the
information from the table and allow additions. The table will contain the
artist's name, the album name, and the type (C for CD, T for tape, R for record).
- Create a table of this form:
|
music_info |
|
|
artist |
text |
|
album |
text |
|
type |
char(1) |
Copy the file music.unload from /mokihana/homes/cs594ir_sp03/public and load it into the music_info table, if you want some starting data, or create your own
tab-delimited file of data to load into the table.
Create a login web page which asks for your database username and password
and passes them to another page. (Note that HTML forms support an input type
called "password" which will act like a text box but echo only asterisks to the screen.)
Create the second page, which will read the name and password passed by the
form and open a database connection using the name and password given. It
should then display all the information from the music_info database table in an HTML table in alphabetical order by artist's name.
Add three sort buttons, Artist, Album, and Type, which will sort the data by
the named field and redisplay it.
Add an Add button which will take the user to a form to enter new
information into the database, add the information when the form is submitted,
and return
the user to the main page, redisplaying the table with the new row.