CS 235: Assignment 6

Due in class, Tuesday, November 15, 2005


DatingBase: Part 6

The sixth part of the DatingBase project is to access your database using the php programming language and a web server.

First, you will need to create a directory named cs235 in your html directory. If you don't have html directory in your home cs directory, follow these instructions on how to create one.

Next, you will create a web page that will be the (temporary) interface to your DatingBase. This web page should consist of links and forms (and short explanations for any complex functions) that implement the functionality needed by your DatingBase. The functions and their parameters will depend on your schema and interaction rules. At the very least, you should write functions that implement the following (or something similar if any of the queries listed below do not make sense for you schema):

  1. List the names of your tables (link).
  2. List the names of all users (link).
  3. List the attributes of a user given a username (form).
  4. List the average number of views per user (link).
  5. Allow a user to register (form).
  6. A user sends a message to another user (form).
Every link and form on this web page should correspond to (and implement) a particular functionality of your DatingBase. For this assignment, you will only need to implement 8-10 functions. Here is an example of a web page, cs235hw6.html, that has a link to a php script list_tables.php and a form that runs list_attrs.php. Note that the names of the files have an extra .txt extension so the source code can be viewed in your browser.

For a quick primer on HTML forms you can go to http://www.pagetutor.com/pagetutor/forms/index.html.

For more information on how to handle form variables passed to php refer to this section of the php manual http://us3.php.net/manual/en/language.variables.external.php.

For more information on accessing MySQL from php read http://us3.php.net/manual/en/ref.mysql.php.

Your web page which contains all links and forms should be named cs235hw6.html and should be placed in your html/cs235 directory. Make sure that this page is readable by a browser by accessing the following url: http://www.cs.uchicago.edu/~your_username/cs235/cs235hw6.html

Problem Set

You will complete the problem set online using Gradiance. Log in at http://www.gradiance.com/services.

The name of the homework is CS 235 Homework 6. All questions in this problem set are multiple choice. However, to answer them correctly you will need to work out their long (general) answers. A correct answer is worth 3 points. You lose a point for each incorrect answer. You can take the assignment as many times as you like; only your last score will count. Note that you will probably get slightly different questions each time you take it.