CS437/637 - Database-backed Websites and Web Services, Spring 2018

Welcome to CS437/637 Spring 2018

This class will cover database-backed web sites and web services using SQL and PHP as the main programming languages. You need good programming skills and CS430/630 for SQL, or an equivalent introductory database course covering SQL, E-R diagrams, and client programming (in C, Java or PL/SQL). It is good to know basic HTML, including forms, but these topics will be covered in homework. There are plenty of tutorials for HTML on the Web.

Class meets MW 7:00-8:15 in M-3-430
Professor: Betty O'Neil (eoneil at cs.umb.edu)
Office Hours: MW 3:45-5:15 and by appointment, in S-3-169
Grader: Adit Shah (ashah at cs.umb.edu)

Homework and Programming Assignments: Prerequisites: CS310, CS430/630 (these are important), and officially, CS451/651 for CS637 only (less important, can be replaced by programming experience). Note that CS310 is an implicit requirement for all (applied) CS graduate courses. It means you need to know data structures, preferably implemented in Java (C++ is also OK), including use of Collection classes like HashMap. However, if you are solid on intermediate Java, as covered in cs210, that should be sufficient for this class.

Note that I also teach CS436/636 Database Application Development, usually in the fall. You may take both classes if you wish. Both classes use databases for holding persistent data and use HTML5 for web UI, so there is some overlap. It's best to take cs637 before cs636, since it is easier. Here is a quick comparison of these classes:

CS436/636 CS437/637
use Java for business logic use PHP for business logic
requires Java expertise (cs310 or equivalent) requires intermediate Java (cs210 or equivalent)
focus on large or enterprise sites focus on smaller sites
basic HTML5, minimal CSS more HTML5, CSS
layered architecture (presentation/service/DAO) simpler sites, less layering emphasis
use MVC (Model/View/Controller) pattern for web UI use MVC (Model/View/Controller) pattern for web UI
use Oracle or mysql interchangeably use mysql
default to using eclipse IDE default to using NetBeans IDE
run your own tomcat application server run XAMPP, your own Apache webserver, mysql, PHP site
only discuss web services study and implement web services

Note: If you are interested in preparing to use .NET, you should probably take CS436/636, since .NET is an enterprise platform, like JEE.


Student Information sheet, with list of essential skills needed for this course

Texts: print editions required for open-book exam use

Murach's PHP and MySQL (2nd or 3rd Edition) by Joel Murach and Ray Harris, Murach & Assoc, 2014, available for example at Amazon (older edition (less expensive), newer edition) or the bookstore. This book cover basic web technology (HTTP), running XAMPP for your own PHP web server, using the MySQL database. Follow the book link for free code.

HTML and CSS: Design and Build Websites by Jon Duckett, under $20 at Amazon. Follow the book link for free code.

Recommended for HTML and CSS, including slightly more advanced CSS examples:
Learning Web Design, by Jennifer Robbins, O'Reilly, about $40.

Getting Ready:
Check out your development PC: A Windows 7 system with at least 2GB of memory works well with these tools. Windows 8 or 10 is fine. Alternatively, a Linux system or recent MacOSX system will work well. Setup directions are provided for Windows, Linux, and MacOSX, in the Appendixes of the text. Also see "Access to cs.umb.edu systems" linked below under Resources.

First week: Get a UNIX/Linux account for cs637 by running apply, even if you already have a UNIX account here. This will give you access to our Linux host topcat.cs.umb.edu, which has a MySQL installation and an Apache web server enabled for PHP. You can try out the book's examples even before you get an account: see the link below under Resources.

Slides, etc.

Mon., Jan. 22 slides (6pp) Intro, start on HTML
Wed., Jan. 24 slides (6pp) HTML5: Duckett Chap.  4-7
Mon., Jan. 29 slides (6pp) HTML5: Duckett Chap. 8-12, including intro CSS
Wed., Jan. 31 slides (6pp) CSS: Duckett Chap. 13-14
Mon., Feb. 5  slides (6pp) Murach & Harris Chap. 2 Intro PHP
Wed., Feb. 7 slides (6pp) More on Forms, slides (6pp) M&H Chap. 3 Mysql, Intro to Pizza Project (doc)
Mon., Feb. 12 slides (6pp) M&H Chap. 4 PHP and Mysql
Wed., Feb. 14 slides (6pp) M&H Chap. 5 MVC apps
Mon., Feb. 19 Holiday
Wed., Feb. 21 Continuing on Chap. 5, slides (6pp) Chap. 6 Errors and Debugging
Mon., Feb. 26 slides (6pp) Chap. 7 Forms and Form Data slides (6pp) Chap. 8 Type Juggling, etc. numberguess (zip)
Wed., Feb. 28 slides (6pp) Chap. 9 Strings and Numbers slides (6pp) Chap. 11  Arrays
Mon., Mar. 5 Arrays, continued Arrays Practice Sheet (Solution)
Wed., Mar. 7 Campus closed by bad weather, no class, turn in hw3 on Mon, Mar. 19
Mon., Mar. 19 slides (6pp) Chap. 12 Sessions and Session variables (not for use in the pizza1 project!)
Wed., Mar. 21 Campus closed by bad weather, no class
Mon., Mar. 26 slides (6pp) Midterm Review
Wed., Mar. 28 Midterm Exam Practice Midterm Exam Solution
Mon, Apr. 2: Midterm exams returned, slides (6pp) Chap. 13 Functions
Wed., Apr. 4: slides (6pp) Chap. 14 Objects
Mon., Apr. 9 slides (6pp) Chap. 20 Larger Website (after finishing Chap. 14)
Wed., Apr. 11: continuing with Chap. 20.
Mon., Apr. 16 Holiday
Wed., Apr. 18 slides(6pp) Chap. 22 and Intro Web Services, slides(6pp) More on HTTP
Mon., Apr. 23 slides (6pp) PHP Web Services, part 1
Wed., Apr. 25 slides (6pp) PHP Web Services, part 2
Mon., Apr. 30  canceled by fire alarm
Wed., May 2 slides(6pp) Debugging Project 2 slides (6pp) Securing the WebSite (Chap. 21)
Mon., May 7 slides(6pp) An eCommerce Website (Chap. 24): users, session vars, checkout wizard
Wed., May 9 slides (6pp) Project 2 Review slides (6pp) Final Review

Wed., May 16 6:30-9:30 in M-3-430 Final Exam (we'll try to start about 6:15) Practice Final Exam Solution

slides(6pp) Chap. 23 Files, Images
slides(6pp) Selenium


Homework 1 due Monday, Feb 5, in class, on paper. Solution
Homework 2, due Wed., Feb. 21, in class, on paper. Solution
Project 1 doc assignment: first delivery, due Tuesday, March 6, by midnight, in /var/www/html/cs637/<username>/pizza1 on topcat
Project 1 starting point: pizza1_setup (zip) Solution
Homework 3, due Wed.,
March 7, in class, on paper (do this first, before project 1 first delivery) (#5 updated on 2/24) Solution
Project 1 final delivery: Tuesday, March 20
, by midnight, in /var/www/html/cs637/<username>/pizza1 on topcat
Note: first late day for project 1 is extended by University closing to midnight Thurs. Deadline now Friday midnight.

Project 1 Solution: zip deployed (from login: can see files at /data/htdocs/cs637/pizza1)

Homework 4, due Wed., April 18 in class, on paper. Arrays, pizza1 Solution, Session variables, Intro objects Solution

Homework 5, due Mon., April 30 in class on paper (OK to turn in on Wed., May 2 in class), plus two (small) projects on topcat's web server by midnight. Objects, Unit Testing, Session Variables, HTTP Headers Solution

Project 2 assignment proj2_setup.zip  deployed  working project images Solution: proj2.zip deployed
Note: proj2.zip updated 5/13/18: wrong project zipped earlier (the proj2_setup)


Piazza Class Site

Home page for Spring, 2017

Access to cs.umb.edu systems from offsite Logging in and transferring files. (Updated Feb. 1 to remove unnecessary Oracle info.)

Development Setup Installing needed software. Some discussion of topcat.cs.umb.edu as well.

The book webapps deployed on topcat.cs.umb.edu and using the MySQL database on topcat.cs.umb.edu

HTML5: Intro at www.w3schools.com latest spec forms tutorial tag reference, with HTML 4/5 info  HTML5 validator

CSS3: Intro at www.w3schools.com CSS2.2 property index. More on CSS: mozilla.org  css-tricks.com

HTTP : tutorial

MySQL We are using MariaDB (compatible with mysql 5.5, 5.6) bundled with XAMPP, and also version 5.6 on topcat.cs.umb.edu. docs (SQL)

PHP The version of PHP is important to note because it is still evolving, although not significantly between versions 5.5 and 5.6. We are using version 5.6 bundled with XAMPP, and version 5.5 on topcat.cs.umb.edu. Our second edition text uses version 5.5, and the third edition uses version 7.1 (see pg. 12 in either edition). docs evolving spec

PHP Internals: How Variables and References Work

PHP Debugging Setup and Use Note that the directions on setting up XDebug in the Appendices of  the second edition of M&H apply only for older versions of XAMPP.

PHP Debugging Session: video 

REST Web Services Tutorial