|
Assignment 1 - Server Side
Includes & PHP
Since the emphasis of this course is server-side programming you may copy the HTML/CSS from the working samples to use in your MIS 314 assignments. Remember that all server-side code must be your own work.
You will be creating several files for each assignment. I suggest creating separate folders on the server for each assignment, giving the folders names like A01, A02, etc. The files names for each exercise should be the same as those specified in the assignment.
Submitting assignments:
- Please carefully follow the submission instructions at the bottom of each assignment. Assignments not submitted correctly (not sent to the correct email addresses, incorrect URLs, etc.) are subject to penalty.
- The most reliable way to assure that links are correct is to cut-and-paste the URL from your browser into your email.
- List the links in the correct order.
- Assignments will be graded within a few days of the due date. You will receive an email from Professor Sandvig when each assignment is graded. Please check your assignment grades. Any grading problems must be brought to my attention within one week of the email.
1. SsiDemo.shtml -- Server-side
includes (SSIs) are supported by many servers (such as Titan) that do not support
PHP and other more sophisticated
server-side technologies. SSIs are
very useful for reusing code across multiple pages for such
thing as headers, footers, and navigation menus. This page demonstrates
the options available with server-side includes. Steps:
-
Use Aspen to create
a new file named SsiDemo.shtml and paste the this
html code into your new file
(you do not need to edit, just paste the code).
-
Create a file named footer.txt and use the SSI "include file"
command to include it in SsiDemo.shtml. Include some text in your footer that identifies it as the footer, such as "This is my footer."
-
The file name extension .shtml or .php tells the
server to find and process SSIs. To see the output you will need to
view the page through a browser (http://...) so that the includes
are processed by the server.
2.
Lion.shtml --
Use SSIs to include the same header, footer and menu on three separate pages. The body of each page should have a
different picture (you can use the photos in the example or your own
pictures). Your header should include as SSI to display the current date,
as in the example.
Tips:
-
You will create six files for
this assignment: Lion.shtml, Giraffe.shtml, monkey.shtml are content
pages. They will include SSI tags to display the header, footer and
menu.
-
header.html, footer.html
and menu.html contain the HTML for the SSIs.
-
Use your browser's "view source" to see the HTML in
the sample. You may copy the HTML for the menu, header and
footer.
-
If your SSIs are not displaying properly, use your browser to
look at the source code for your page. If you can see the SSI tag in
your source code then it didn't get processed and is being treated
by the browser as a html comment. Possible reasons are 1) your page
does not have the extension .shtml or 2) there is a syntax
error in your SSI tag.
3.
ClockLoop.php -- Modify the example
Clock with Loop to display the clock 10 times. Put the For
statement where you want the loop to begin and the Next statement at
the end.
4. Make sure that you have
added your name to the class roster (see link at bottom of page)
so that your assignment grade can be recorded. If your name is not on the roster when asssignment 1 is graded you will not receive credit. |