CS 207 Lab 4
Feburary 6, 2017
Please note: Once again, a form to tell me
what you are doing
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
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
http://osiris.ubishops.ca/~jensen/private (you'll need to know the password for user
"cs207" - see me)
What to work on this week
- Add 2nd table, provide for web input to it, as well as your
first, and provide for showing the join of 2 tables
- Make your pages look nice
- Describe what the site is about, and its features
- Explain WHY I might want to register, for instance
- Make use and navigation easy.
- Add style, pictures, and colour
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
- Provide a means (expand your form, or addtional form) to enter
data into this second table. Alow me to do so. This means:
- There is a link
that's obvious near the top of your index.html, and
- If it is private, give me a username and password.
- 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.
- You have some information about authors, and a table of books.
(Agatha Christie wrote a lot of books.)
- You have books and borrowers, and you will record who has
borrowed or returned a book.
- Several women have complained about Donald T.'s behaviour.
- Members of the Rock Climbing club might also belong to other
clubs. (a many:many relationship)
Tell me what you have done: use form below
Please tell me:
- What tables you have, and how ther are to be joined (on which
columns, in other words, what you have declared with REFERENCES)
- The names of your files that contain forms or receive form data.
- If necessary, Any username / password I might need to access your
To receive full credit for the lab:
- You filled this week's form at least once
- 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.
- Don't store passwords in plain text - use md5() or similar.
- Your picture is in the class list, if it wasn't there last week.
Some points to consider:
- Easy site navigation. Should flow naturally from page to page.
Always give one or more possibilities in links or forms, to go
- 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?
- Use appropriate SQL types, such as date, integer, or money
if that's what is wanted, rther than 'yesterday', 'lots', or 'a song'.
- Use HTML5 types "email", "date", "number", "phone" etc. when that's what you want. (but be aware that browser support is still variable)
- 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.
- 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.
- Make your administrators accountable! When authentication Is
required, the user name is available to php in $_SERVER['REMOTE_USER']
(see my private/hello.php)
- 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.
- 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