Web Design and Programming II
search |
 
Overview
Syllabus
Schedule
Projects
Homework
Site Map
Resources
Q & A
Discussion
Notices

HOMEWORK ASSIGNMENTS for CS Students

This is where CS students check for new homework assignments. When you are done, send your CS homework by email to the CS instructor and TA Saleh Alshomrani (salshomr@cs.kent.edu). Send your VCD homework assignment to the VCD instructor not the TA. Please use subject line WDP-2: CS HW1 for cs or WDP-2: VCD HW1 for cs. It is important to get the subject line right.

If your homework involves html coding, please note that you need to get around the PHP enabled Web server by replacing the first line of your XHTML file with

<? print('<?xml version="1.0" encoding="UTF-8"?>'); ?>

TA: Saleh Alshomrani
Email: salshomr@cs.kent.edu

CS HW1, Due 1/31

  1. Do the CS HW1 for vcd students as part of this assignment.
  2. Follow the hands-on experiment HTML Forms and PHP (Paul's notes) and write showglobal.php to display, in tabular format, all values in the PHP super globals $_SERVER, $_GET, $_POST and $_ENV (Hint: How do you take an array and print out all of its key-value pairs?).

    Implement a gform.html that has a link to send a GET request to your showglobal.php. Also implement a pform.html that has a form which sends a POST request to your showglobal.php. Test your programs.

    Place the .php files in your $HOME/public_html directory (use your CS computer account) and access them through the cgi.cs.kent.edu server with a URL in the form:

    http://cgi.cs.kent.edu/~your_userid/filename.php
    

    To submit the homework email all the PHP source and the URLs of your working HTML pages.

    (Note: If you have trouble accessing or setting up your CS account or have access permission problems to the web page you created, please see this file for help.)

VCD HW1, Due 2/11

VCD Homework 1 is located in Sanda's notes section. Please download all three files to see how to do the homework:

  1. hw1
  2. marsSch_usgs.gif
  3. vcdhw1-structure.psd

CS HW2, Due 2/15

Take the Cray Pizza Shop hands-on example and add different prices to each item and keep track of the total of the order. When the customer clicks the Done button, it leads to a 2nd page that lists in a shopping cart form, each item with pricing and the total. A Confirm Order button on this page ends the session and leads back to a new order page.

CS HW3, due 2/28

Part One: Follow the hands-on experiment ``MySQL access from PHP'' and write a PHP function displayRows($resultSet). The function is passed a result set, from a SELECT query, and returns a string representing table rows in an HTML table (the parent <table> element is not part of the string). This returned string can be empty if the result set contains nothing. Write the function so it works in general for any incoming result set. Write a testTable.php page to test your displayRows function.

Note that you can use the ORDERED BY colname sql condition in a query to obtain result sets in sorted order by the indicated column. Or, after a result set is obtained, re-sort it using your own PHP code.

Make your displayRows function able to display the rows in sorted order on any given field indicated by the function call. For example displayRows($resultSet, 3) sorts based on the 3rd column. You can do this by extracting the rows in the resultSet into a arrays and use the PHP function array_multisort to do the sorting before displaying the results.

Hint: See this file.

Part two: Take the course questionnaire and modifiy it to enter the collected info into a database table. And write a teamroster.php page to display info from this table.

CS HW4 for CS students, due 4/14

Take the Visit Detroit example (with all the images and scripts there), and improve on it. Make the panning control work with two buttons (left and right arrows). The action keeps going as long as the button is pressed and stops when it is released. Then add double-arrow buttons for faster panning. Make the Flash using Flash CS3 and ActionScript 3.0.

CS HW5 (for CS students), due 4/23

The purpose of this homework is to get each CS student to install his/her own Apache web server with PHP under Unix.

Please go to b1.cs.kent.edu or cgi.cs.kent.edu and install the Apache server in your own home directory under a directory such as apache_2.0. This also means you need to use the correct --prefix= when you configure your Apache before making it.

  • Set document root to apache_2.0/htdocs

  • Set the port number used to 8080 (accessible from outside of the CS department firewall) or some other port above 1024 (which may not be accessible from outside the firewall).

    ###Listen 80
    Listen 8080
    
  • Install and run your Apache server from one of b1, b4, and cgi in the CS department.

  • Follow carefully the directions in this guide to install your Apache server with php

  • In the conf/httpd.conf file, use the following settings:

    	MinSpareServers 1
    	MaxSpareServers 2
    	StartServers 1
    	MaxClients 5
    

    to limit the number of copies of the server you run, because you will be the only one experimenting with the server.

  • Figure out how to start, stop, dynamically reconfigure, the server. Take note when you start your server, which computer (host) you are on. The UNIX hostname command will display your host name under cs.kent.edu.

  • Hint: the URL of your server is something like http://b1.cs.kent.edu:8080

Start your server to do experiments. Stop it when you logout. Don't leave the server running to avoiding overloading our sysstem. When you start the server make sure it uses your own httpd.conf file instead of the system default (usually located in /etc/httpd/conf). This is done by going to your own apache_2.0/apache/bin directory and issue one of these commands:

./apachectl start 

$HOME/apache_2.0/apache/bin/apachectl start

After testing, remember to stop your server so it frees port 8080 for others to experiment.

./apachectl stop 

$HOME/apache_2.0/apache/bin/apachectl stop

Keep this server around for use in this course. When you are done with the course, you should delete the whole Apache directory.

If you know how, you can also put Apache on your home computer so you can experiment with it at the standard port (80).

When you are done, you should send the following to the instructors and the TA:

1) host:port of your server,
2) how the TA can start/stop it,
3) location of your own document root
4) the special configuration lines you have placed in the 
   httpd.conf file (not the whole file, just the conf 
   lines you have added/edited),
     
5) the URLs of files you have used in your document root to test
  your apache server

Make sure the TA and the instructors can access and execute your Apache commands without permission problems. Note the following

chmod a+r apache
chmod a+x apache
cd apache/bin
chmod a+r *
chmod a+x *
cd ../logs
chmod a+r *
chmod a+w *

If you wish to add PHP and perhaps MySQL to your server installation (do it on your own PC) see this page for more info.

For extra credit and your own satisfaction, add PHP support to your Apache Web server. Download the current php verstion for Unix/Linux: (http://www.php.net/downloads.php) and refer to these instructions.