CS 207 Lab 4

Feburary 12, 2024

Please note: Once again, a form to tell me what you are doing

Hi everyone.
It is great you are all doing different things.

For example, many of you are collecting user information, and then allowing trusted administrators to view and search the data.
Others are allowing administrators to post news, which can then be viewed by the public.

-- Eventually you will probably want to do both: Customers or users are the public, your staff manages product or service offerings.

However, I may have trouble finding or using your features. A real user might have even more trouble. Therefore, please submit a brief description of your work, just like you did (or should have) last week.

To see the instructions on how to set up a private folder (must be named "private"), see http://osiris.ubishops.ca/~jensen/private (you'll need to know the password for user "cs207" - see me)

What to work on this week

Some suggestions

The details:

A second table

If you have not already done so, create a second table that is related to the first, so it makes sense to join the two tables. If you have tables that can't be joined, are they in fact part of the same "project?"
With these:
  1. Provide a means (expand your form, or addtional form) to enter data into this second table. Alow me to do so. This means:
    1. There is a link that's obvious near the top of your index.html, and
    2. If it is private, give me a username and password.
  2. Provide a simple means to view the join of the two tables. The whole table is fine, only implement a search if you wish to. In other words, a php page that does a select statement.

Some examples:

Tell me what you have done: use form below

Please tell me:

To receive full credit for the lab:

  1. You filled this week's form at least once
  2. Insert into both (more than one) tables work, and showing the join of 2 tables also works. (I can insert some data, and see it in the result). I can use the password you gave me, if necessary, or the one I registered with, if that's what you are doing.
  3. Don't store passwords in plain text - use md5() or similar.
  4. Your picture is in the class list, if it wasn't there last week.

Some points to consider:

  1. Easy site navigation. Should flow naturally from page to page. Always give one or more possibilities in links or forms, to go somewhere.
  2. Be clear on what type of input goes where. Should that box contain an email address, or a city, or an integer ID?
    What is being searched for? All or part of a name, or city, or activity?
  3. Use appropriate SQL types, such as date, integer, or money if that's what is wanted, rther than 'yesterday', 'lots', or 'a song'.
  4. Use HTML5 types "email", "date", "number", "phone" etc. when that's what you want. (but be aware that browser support is still variable)
  5. Be careful, especially with user input. Always use pg_query_params for database operations with user data, escape output to html pages with html_specialchars.
  6. Consider your database design. You will in general need to know how to get tables to work together. Avoid redundancy, allow related tables to be joined, create rules or views as appropriate.
  7. Make your administrators accountable! When authentication Is required, the user name is available to php in $_SERVER['REMOTE_USER'] (see my private/hello.php)
  8. Avoid ugly warnings, check your input! If it must be integer, is it? If it would violate primary key uniqueness, should you do an update instead of an insert? if date is blank, that's invalid, use NULL for no date, etc.
  9. Is your site interesting?

Tell me what you have done this week

You may fill out this form multiple times, in case you have more to say. For example, you might want to tell me about 2 or more different pages, or tell me about something else. I will see all the submissions, so don't be redundant.
If your work is in a subdirectory named, let's say, "FishPond", the appropriate "page name" below would be FishPond or FishPond/index.html

Your Linux code
Name (only) of ONE page: where I should start looking for a form. (no ~ please)
What you did new this week:


Valid HTML
          4.01 Transitional