Introduction
For this assignment, you are to use your laboratory account to create a web page based on the file named “course_template.php” that I distributed in class. You are to modify the template according to the requirements listed below, and you are to verify that it operates correctly using one of the web servers in the laboratory. When your web page works, send me an email with “CS-081 Assignment 1” as the subject. In the body of the message, all you have to put is your first and last name so I can figure out what your account name is.
Procedure
Log into your account using any of the computers with a tree name in room A-205. The first time you log into your account you will have to change the password: be sure to pick a good one, because the lab computers are directly connected to the Internet and subject to attacks from outsiders who would love to use your account to get you and Queens College into trouble.
Under “My Documents” you will find a folder named “My Web Pages”. This is where you will create all your web pages for this course. Create a folder under “My Web Pages” named “Assignment_01”. Be sure you spell and capitalize the folder name exactly like that so I will be able to retrieve it when you submit the assignment.
Use either Vim or Dreamweaver to create a file in “Assignment_01” named “index.php”. Again, the name of the file must be spelled and capitalized exactly as shown. This time it’s because that’s the name the Apache server will look for when you deploy your assignment for testing. I have written a Tiny Vim Tutorial to get you started with Vim. And I am working on a Dreamweaver Setup page to help you with that option if you choose it.
Type the contents of “course_template.php” into your “index.php” file. Warning: you have to type it exactly right for it to work, and the error messages you will get for doing something wrong in the first part of the file will not be helpful!
Deploy your web page. Copy (don’t move) “index.php” from your “Assignment_01” directory to “C:\htdocs”. If there is already a file with the same name there, just overwrite it. Use Firefox to view your web page by using the URL, “birch.cs.qc.edu”. Substitute the name of the computer you are actually working on for “birch” in that URL. See if the page looks right. If it does, then:
- Check to see that the TIDY indicator mentioned in class is green with a check mark.
- Look at the Page Info by clicking on Tools->PageInfo. Be sure the Type is “application/xhtml+xml” and the Render Mode: is “Standards compliance mode”.
- Click on the XHTML link at the bottom of the page and be sure the W3C Validator comes up with a green bar saying, “This Page is Valid XHTML 1.1!”
If any of the above items is not right, correct the original page in your “Assignments_01” directory, redeploy the file, and check everything again. Repeat this until the page is perfect.
Modify the Template
Now modify your course template file. First, make a copy of “index.php ” in your “My Web Pages” folder so you can use it as a starting point for other projects this semester.
Make the following changes to “Assignment_01\index.php”:
- Change the title of the page to your name.
- Change the h1 element’s content to match the page’s title.
- Note that there is an error message displayed following the “Last updated” message at the bottom of the page. Make the change needed so the correct date is displayed. (Congratulations, you are now a PHP programmer!)
- Write a paragraph of information about something under the h2 element, and change the heading to indicate what the paragraph is about.
- Create a second h2 element under the paragraph you just wrote, and use “Lorem Ipsum” as the name of the section. Add two paragraphs under this heading with information generated by www.lipsum.com/.
Deploy, test, and edit your page until it is perfect again.
Be sure you log off from your account when you are finished. This is critical for two reasons: (1) If you don’t log off, your work won’t get saved to the server and I won’t be able to retrieve your assignment for grading, and (2) Only one person can be logged on at a time; if you don’t log off, no one else can use that computer.
Submit Your Assignment
As stated in the Introduction, submit the assignment by sending me an email message. Even if you do the project with someone else, you both have to send me email, and you both must have correct code in your “My Web Pages\index.php” files. And your own name has to be used for the title of the page and the h1 header.
Due Date: Midnight, February 10.