Web Programming II

HOMEWORK ASSIGNMENTS

Homework can be submitted by the due date ONCE. After a HW is submitted, no revisions will be allowed. Your submitted HW will be graded after the due date.



HW3 due 5/6: No extensions will be allowed.

Mobile and Desktop implementation of an ordering system

  • Adapt the site for a multi-step order session with required login that you implemented in Homework 1, so that it works well for both desktop and mobile (cell phone) sites
  • You should make the main site hw3.php auto-detect whether the connection is from a desktop or mobile browser and adapt the site displayed to accomodate the device.
  • The site should have all the same functionality as that in Homework 1.
  • You may use the same implementation using plain text files, or you may choose to reimplement the site using MySQL

  • Important: Use of packages such as PEAR or JQuery is not allowed.

    Place your homework in the /var/www/html/your_Flashline_user_id/wp2/hw3/ folder and the hw3.php there is to be the entry page to be accessed with the URL (all on one line)

    http://webdev.cs.kent.edu/your_Flashline_user_id/wp2/hw3/hw3.php
    
    Note the URL is a strict submission requirement.



HW2 due 3/25:

Study and use the materials on MySQL and PHP access to MySQL.

  1. Create a database driven set of forms that record details of faculty members and their interest in serving on committees.
  2. You may access your per-student database using the information given in the https://webdev.cs.kent.edu/your-user_name/DB/DB_Access.html You may find it useful to use the phpMyAdmin link there to help setup the databases.
    To access your database tables from your php script the hostname will be webdev.cs.kent.edu and, the login name and the password will be those in the file, and the database name will also be your login name similar to that given in connect.php file:
  3. In your per-student database, set up your own tables based on the the the tables and entries described in hw2-tables. You should modify the descriptions there to maintain consistency of the tables using foreign keys. Note that this may also require changing the attribute descriptions of the fields involved to ensure they are unique. You should also consider whether it is better to remove the row as a primary key and replace it with the abbreviation attribute (abbr). Some suggestions on related atributed are contained in this file.
    The campus, college, dept, rank, status and committee tables are used to setup the survey entries.
    The information on faculty are stored in faculty and the com table records the information a faculty members interest in serving on a committee, one row for each faculty/committee.

  4. The survey should have 3 pages with information held in the session and only written to the database when the Submit button on page 3 is pressed. When the faculty data are written the table should also include a randomly generated activation key, the use of which is described below. The 3 pages should resemble p1, p2, p3, but with only the entries mentioned in the tables described in hw2-tables
  5. After submission a final page similar to page 4 should be shown and an email sent to the email address entered containing a link to the survey with the email and the random activation key generated, like
    Thank you for submitting your Faculty Senate Survey on Committee Interests.
    If you need to change your information you can access it by clicking the following link:
    http:/webdev.cs.kent.edu/your_login/wp2/hw2/update.php?kemail=pfarrell@kent.edu&act=71396133814110948747122028651840717067391761567
    
    which will permit the faculty member to return to the survey with their information filled out to modify their entries.
  6. Should a faculty member try to fill out the survey a second time, and error page similar to p2alt should be displayed and mail send to the email address in the database with a link including the activation key as above.
  7. In collecting information you need to be careful to avoid SQL injection.
  8. Place the first page of the survey in
    http://webdev.cs.kent.edu/your_CS_computer_account_uesr_id
              /wp2/hw2/index.html
    
    Note the URL is a strict submission requirement.
    HW1 due 2/17 extended deadline midnight Sat 2/21:

    Study and use the materials on PHP session control and login and apply the knowledge (and feel free to customize the PHP code) from course notes.

    • Implement a site for a multi-step order session with required login.

    • The session should consist of :
      1. A login page with links for creating an account (user account registration) with a link for users who have forgotten their passwords
      2. An account page which allows a user to change their password.
      3. A page for mailing of new random password for users who have forgotton their password
        • The registration page should gather the user name, login name, password, and email and store them in a file.
        • The login page, entire login session, as well as the registration/forgot password page should be under HTTPS. After logout, such an application should switch back to HTTP. Because webdev.cs.kent.edu/username is a password protected area, this will not work correctly, since it will automatically be converted to https access
        • Out-of-nowhere access to login-protected pages for ordering must be detected and handled correctly.
        • Passwords must be saved in one-way encrypted form. Recommended is the Blowfish encryption available from the php function $pass_code=crypt($pass, $salt); where $salt is something like '$2a$09$Your_Arbitrary_String$'.
        • If you used a text file to store passwords or other information and want that to be modifyable by a web page, it needs to be writeable by the web server daemon which runs as user and group apache. Unfortunately due to the security implemented on our system this requires that use make the password file readable and writeable by all

          chmod go+rw filename
          
      4. Once a user has logged in, an order page is displayed. The order page is for ordering an individual item with a field to change the number (with 1 item as the default). The page will have two buttons to order another or finalize order
        • The order page shows the items available and their price together with a entry field to input the quantity. You should have at least 6 distinct items.
        • When ordering a second or later item the order page should display a list of items ordered so far, the individual price, quantity and total price for each item and overall total cost in a panel on the right.
      5. The finalize order button takes one to a page showing the final order giving the cost of each item and the overall total, and allowing deletion of any individual item, with buttons to update (by applying deletions) or complete order. On update the page is redisplayed.
      6. The finalize button takes one to a page saying order complete and showing the order and logging the user out

      7. Important: Use of packages such as PEAR or JQuery is not allowed, nor is use of databases such as MySQL. Your HTML and CSS must pass W3C validation.

        You may want to download source files (the session and login examples) to help in your work: download hw1.tar or download hw1.zip

        Place your homework in the /var/www/html/your_Flashline_user_id/wp2/hw1/ folder and the index.html there is to be the entry page to be accessed with the URL (all on one line)

        http://webdev.cs.kent.edu/your_Flashline_user_id/wp2/hw1/index.html
        
        Note the URL is a strict submission requirement.

| top |