CSc 315, Lab. 2

Due by Wednesday 24 January 2007

Pat has now set up your account on osiris, this server. Your account code is the same as in the linux lab. Your password is also the same, or you have been given a temporary password, which you must change today (see server instructions below.) You can proceed to put your html file(s) on osiris, so you have a web page accessible from anywhere. As the course progresses, you will be adding features to your pages.
Also today, you will add a table and a form to your pages, and start thinking about learning to program in perl.

Telling a story

Everybody has some story to tell, about themselves, about some group they are involved with about their family or home town. Your homework for the weekend is to gather together some pictures and plan a set of pages telling your story. You could start with a picture of yourself, or art work you have created. You will need to link all your pages together. Your main page will need to be named index.html .

"Your" page

The end result of your work in this course will be an internet page (or several pages, linked together) that either presents you, or an organization you would like to present, to the world. Your combined work also will show off the creativity, interests, and diversity of Bishop's students. So give some thought to what you have to say, and gather up a few photographs or drawings you want to include.

Instructions

In the lab, the goals are:

  1. To add a table to your page.
  2. To add a form to your page (The form inputs could be within a table, in fact.)
  3. To put your html page on osiris, now that your account has been set up. You will learn to use 2 standard internet services:

Please note: UNIX is case sensitive! Both user names and file names must be typed in the correct case. Lower case is the most usual.

Tables:

Tables are a good way of formatting information that fits logically into cells of a row/column arrangement. They are quite flexible, with a number of different options. One interesting one is "spanning" where a cell may span more than one row
or column.  All tags are in pairs, like <table>  </table> which delimits a table. Within a table there are rows, within a row there are Detail items. Within the detail item is the cell's contents. The tags are: (an example follows)
<table> - defines a table. May have border, padding, etc.
<tr> - delimits a row
<td> - defines a cell, with its contents


<table border=1>
<tr> <td> Name </td> <td colspan=2 align=center> Phones </td> </tr>
<tr> <td> Spiderman </td> <td> 822-9600 </td> <td> 911 </td> </tr>
</table>

This will look like:

Name Phones
Spiderman 822-9600 911



Forms:

A form is the logica unit of information that is transferred to an action (a URL, usually a CGI program, but could also be mailto: ...), using a method of get or post. ["HTML quick reference" is the guide you will need to refer to. -- It is gone, see the substitute linked from the outline.] The form ends, as usual, with a </form> tag. Within it, there can be any normal HTML, and also the following value-producing tags:

Step by step for using the server:

In these instructions, things you click on with the mouse are shown bold, things you type in are shown in "tty" font. Some alternate instructions are provided for use away from the lab, were you may not have the same desktop or utilities as in Bishop's labs. We are assuming you have the same account name on both systems. Otherwise, you'll have to connect to myothername@osiris

  1. Modify your web page you started last class (or make a new one) to include a table and a form.
  2. Use scp (or sftp) to transfer your file(s) to osiris. Don't forget any images.:
  3. Check that it is there, using any browser. Your address depends on your login name. For the login name "astudent", the address is: http://osiris.ubishops.ca/~astudent You won't be able to see anything but a not found message until  you have a file named index.html, unless you add a specific file name (after another / ) you will see that file instead. index.html should contain links to any other files you have. You will only be graded upon files that are linked from index.html.
  4. Start a terminal, and start a ssh session on osiris:   (see Putty instructions if you have windows at home.)
    ssh osiris
    1.  You should be asked for your password. If you do not in fact have an account, see Pat.
    2. passwd   --  if you should want to change your password
    3. cd public_html     Change to your public directory
    4. ls                  List your directory.     (Unix commands are very short)
      ls -l               Check the permissions. Should be -rw-r--r--
  5. Test your html file from the location: http://osiris.ubishops.ca/~<youracct>

What to do today:

  1. Have a set of pages, linked together, that tell some kind of story: About yourself, about a group, about a company you run, or imagine. (If you invent a fictious organization, be sure to put a disclaimer, saying that this is a student project, and that "Space vacations.com" is not an operating company.)
  2. Add a table of your own design. Make it interesting and related to you in some way. This could be your brothers and sisters,  info about schools you attended, etc.
  3. Make sure that you have one page with the file name index.html, then be sure that it always contains links to your other pages (use a relative link, i.e. just the file name.)
  4. Construct a form on your main page or another page, to gather some information for the story you are telling. For instance, it could be a guestbook entry, an order form for a selection of books, or a quiz on some subject. A form must have a submit button and should also have a reset button. Use a reasonable variety of ways of gathering data. In fact, please use 4 out of these five:
  5. Test the working of your form by specifing as action:
  6. [By Friday, practice writing a perl program.] It should prompt for and accept some input, and calculate some results. Include an "if" test and a loop, at least. Picking up Perl is a freely redistributable tutorial, you can use as well as the textbook. See also my sample Perl program.
    Suppose your program is called  first.pl You can run it by typing either:
  7. Submit your perl program using submit csc315 ...

Please notice that spaces and special characters are specially encoded in your form data. Also notice that the data comes in name,value pairs, with some special characters as separators. What are they? (This is why special characters in the data need to be encoded.)

Things to check for:

This lab is complete when you have submitted a perl program, and you have a working form on osiris, that I can find by typing http://osiris.ubishops.ca/~youracct

You have finished "lab 2".


Prepared by Lin Jensen , 2 May 2000. Updated 23 January 2007

What to do if you are stuck with a windows machine:

Start putty in ssh mode (not telnet). putty.exe is a client for the telnet and ssh protocols. Putty is open source, GPL licensed software. This means you may copy and use it, but may never sell it. A copy that runs under windows is in R:\csc315.a09\read, you can drag its icon to the desktop to create a shortcut. You may also make a copy to take home or download one for your Mac, etc. from the internet.
  1. Click on the desktop icon to start putty.
  2. In the connect menu, choose ssh. The system you want is osiris.ubishops.ca You don't want to change anything else.
  3. You will see a "login:" prompt. Type your login name (case sensitive), and press enter.
  4. Contunue with the regular lab instructions

Using WinSCP (At Bishop's) [Can also be copied from R:...CSC315.A09/READ to take home]