INTN 2201: Lab Assignment 4:
Chapter Files from Textbook
Due Date and Marking
Lab 4 is due by February 20th 2010, by midnight. This means that you must
have submitted your link by that time (see "Handing In" section
below). You will receive feedback within a day or two, giving you your mark out of ten, and the reasons for
any loss of marks, to be used as constructive criticism (i.e. fix the problems before the next lab is submitted)
General
For this assignment you will be required to access the book
PHP 5 Fast & Easy Web Development on Books 24x7.
You will be reading and wokring through example exercises, creating several files for this assignment.
N.B. in order for the opentech server to recognize and resolve any of your PHP scripting you
MUST utilize the <?php opening tags, not just <?. Though <? will work locally on
your laptops running Apache and PHP, opentech will ignore, and you WILL lose marks.
You are to read chapters 4 and 5 and work through all of the example exercises.
After doing the required reading, you are going to have to produce a link from
your "index.html" page (in your navigation section) to your "lab4.php". It should be clearly
labeled as Lab 4.
Specific Requirements
-
Your php files are to implement your cascading stylesheet from Lab 3 (this should be achieved by including your header).
-
Your PHP pages must be XHTML valid, to the same standard as your first three assignments
and the first term test.
- To ease web site maintenance you will pull the banner and nav bar off of your
standardized pages, and place them in a file called "header.php"
- You will pull any bottom of the page and/or right side nav bar and place it
in a file name "footer.php". This footer.php should include the XHTML and CSS validation images.
- You will replace the tops and bottoms of your standardized pages by including
"header.php" and "footer.php" in the appropriate spots. E.g.:
<?php include 'header.php'; ?>
Be sure to change your file extension on your "index.html", "lab1.html",
"lab2.html" "lab3.html" and "termtest1.html" to *.php. Otherwise the server will not
know what to do with the include statement
- At the top of each page you are to create string variables named $title, $date, $filename, $banner and $description that contain the title for the page,
the date the file was created, and a brief description of what the page is doing. These should be declared above the include 'header.php'; line, inside the
header.php file. You are to echo
these variables (the $title inside <title> tags, and the $date and $description as part of your HTML comments <!-- -->.
-
Each file produced below for this assignment should include a set of php comments that state your name,
and the course code (INTN2201) and the date you created the file.
-
Each file produced should also include a set of header tags (in the body of
page) that states title of the textbook section, and <p> tags giving a
description of what the file is doing/demonstrating.
-
Each PHP file produced should also include a clearly labelled link back to the lab4.php (in addition to the nav bar included as part of the header.php file).
page
-
Your "lab4.php" file should have a clearly labelled link to each of the php
files created below (be sure that your a:link and a:visited css selectors work,
for ease of marking).
-
Produce one appropriately named php file (with a lab4 prefix), including implementing your header.php and footer.php
files, for each of the following program examples in the textbook titled:
- PHP Start and End Tags (Chapter 4) E.g. this file could be named lab4tags.php
(Click to see an example of what the instructor is looking for).
- Code Cohabitation (Chapter 4)
- Escaping Your Code (Chapter 4)
- Commenting Your Code (Chapter 4)
- PHP Variable and Value Types (Chapter 5)
- Using Constants (Chapter 5)
- Using Constants 2 (Chapter 5) untitled section in USing Constants section, refers to constants2.php
- Assignment Operators (Chapter 5)
- Comparison Operators (Chapter 5)
- Logical Operators (Chapter 5)
Your pages ALL need to be XHTML valid, therefore do not use the UPPER CASE letters on you HMTL tags as shown in the text. Remember this is a PHP textbook, NOT an HTML textbook.
Handing In
Publish your pages on the opentech server and submit the URL of your index page to YOUR lab instructor. The
preferred method/location for the various instructor is:
| Instructor
|
Method
|
| Stephen Franks
|
Place URL in the appropriate lab drop box on WebCT
|
| John Mather
|
Mail your URL to
john.mather@durhamcollege.ca. BE SURE TO INCLUDE THE COURSE CODE AND
LAB NUMBER IN THE SUBJECT LINE.
|
| Darren Puffer
|
Mail your URL to
darren.puffer@durhamcollege.ca. BE SURE TO INCLUDE THE COURSE CODE AND
LAB NUMBER IN THE SUBJECT LINE.
|
Don't mail your files themselves or save them into WebCT; they are useless away from the server.
To publish your pages, upload them to the server in the directory /var/www/users/intn2201/userid
(this is the only folder that will work because that's what the Apache Web server
software is configured to look in for your files).
Keep your files on-line until you are sure they have been marked!
Directory and file names on the server are case-sensitive, so be sure to put everything
in lowercase letters. The default page name is index.html. Don't use
spaces, apostrophes, uppercase letters or quotation marks in your file name
(keep it simple, using letters and digits, otherwise people won't find your pages).
Linking file names to URLs
Let's say your login ID is speedy, then your file name on the
server is:
/var/www/user/intn2201/speedy/index.html
The corresponding URL is:
http://opentech.durhamcollege.ca/~intn2201/speedy/
Don't forget the ~ (tilde) symbol. It means "speedy's home directory".
For the rest of the files in your site, you need to give the name in the URL.
The file named:
/var/www/users/intn2201/speedy/page2.html
has the corresponding URL is:
http://opentech.durhamcollege.ca/~intn2201/speedy/page2.html
|