spacer
Home News Links People Catalog
spacer
activepages
spacer

Autumn 2008


DAY/TIME/PLACE

Oct-Nov-Dec - Monday evenings, 6:30pm-9:30pm
CIT 304

Instructor: Bruce Donald Campbell

Faculty, Continuing Education - RISD
Providence, RI

Research Scientist, Human Interface Technology Laboratory
Seattle, WA

Email: bcampbel01@risd.edu

Prerequisites: None                                             Class Roster

DESCRIPTION

This course provide studnets with an orientation and introduction to dynamic content generation Using PHP. Dynamic content creation entails storing dynamic data in a back-end database and querying that data for presentation in XHTML. We use MySQL as a popular open-source relational database management system.

GRADING

Class participation - 20%
Four class projects - 80%

RESOURCES

Books

The recommended book for this class is the third edition of the book PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide, by Larry Ullman (December 2007).

Course Handouts and On-line Readings as identified below and in class


CLASS LINKS

Final versions of our projects as delivered to clients:
  1. ArtStar.org Virtual Artist Gallery (thanks Virginia and Darcy)
  2. The Center for Environmental Visualization Content Gallery (thanks Robert)
  3. The Ocean Project Picture of the Day (thanks Kevin and Virginia)
  4. Save The Bay Citizen Science (thanks Virginia)

SYLLABUS

Date

Topic

Assignment


8 September

Course Overview

  • Course Introduction & Policies
  • Instructor and Student Introductions
  • Opening Survey of Student Skills
  • How PHP fits into the Big Picture of the Web
  • Comparative Web Page Examples (PHP, HTML, XHTML, Flash)
  • Syntax Review / Introduction
  • Managing HTML and PHP a text files
  • HTML Document Structure Review

Look at our class book companion site at: http://www.dmcinsights.com/phpmysql3/.

Look at the four web sites we will be enhancing on in this class:


15 September

Introduction to PHP

Week 2's welcome video is on-line here

Week 2's lecture is on-line here.

Goals:
  • Master the syntax of simple PHP statements
  • Learn about data types
  • Learn about variables
  • Try some mathematical statements
In-Class:
  • The Include and Require Statements
  • PHP Simple Data Types
    • Numbers (int and float)
    • Text (char and string)
    • Boolean
  • Variables
    • What is a variable?
    • Variable Naming Conventions
    • Assignment statements and Weak Typing (versus Strong Typing)
  • Syntax for Mathematics and Precedence
    • Mathematical Operators
    • Mathematical Assignment and Output Statements
  • Some Exercises that Demonstrate Skills Learned

  • Indentifying data types
  • Mathematical operators
  • Begin planning your design for the Artist Gallery Page project.


22 September

Block Statements and Conditions

In-class examples are online here.

Goals:

  • Discuss the Artist Gallery Page in preparation for Project 1
  • Learn about comparison and logical operators
  • Learn about the If/Else construction
  • Master the syntax of block statements

In-class:

  • Introduction to the Image Gallery Project
  • Comparison Operators / Boolean Statements
  • Logical Operators
  • If / Else Blocks
  • Basic For and While Blocks
  • Some Exercises that Demonstrate Skills Learned

  • Boolean evaluations
  • Identifying conditional outcomes
  • Gather images for the Image Gallery I project


6 October

Preparation of Project Work for Class

A discussion of project goals is on-line here.

In class:

  • Review of the goals of all projects and skills required to fulfill them
  • Review of the class development process and opportunity to substitute projects

  • Consider the syllabus for the remainder of our class and be ready to discuss issues you have with the approach we're taking and the project work assigned.


20 October

Arrays, Functions and the "foreach" loop

The on-line lecture associated with this class session is on-line here.

Goals:

  • Learn about arrays in PHP
  • Learn what a function is and what it does
  • See how functions can be used in other statements
In-class:
  • Introduction to Lists
  • One-dimensional Arrays
    • Dynamic Arrays (using the array() function)
    • Static Arrays with Numeric Indices and the Array Access Operator
    • Associative Arrays and the Arrow Operator
    • Variables in Array Accesses
  • The Foreach loop
  • Introduction to Pre-Defined Functions
  • The count() and substr() functions
  • Introduction to Project 2
  • Some Exercises that Demonstrate Skills Learned


27 October

Forms, Form Handling, and Predefined Variables

The on-line lecture associated with this class session is on-line here.

Goals:

  • Review HTML form creation
  • Learn how to respond to a form in PHP (safely)
  • Learn about predefined global variables in PHP
  • Learn a little bit about type-casting
In-class:
  • Introduction to Forms
  • Review of HTML forms
    • Creating Forms and Form Elements
    • Actions and Submission Methods
  • PHP's Pre-Defined Form Variables
  • The import_request_variables() function
  • Checking Input Values
    • The isset() function
    • Type-casting
    • Using the null Comparison
  • Some Exercises that Demonstrate Skills Learned

  • Some simple form-processing pages


3 November

URL parameters, hidden fields, cookies, and sessions

The on-line lecture associated with this class session is on-line here.

Goals:

  • Learn how PHP can create and respond to URLs with parameters
  • Review hidden form fields, and learn to use them with PHP
  • Learn how to set cookies
  • Learn how to use session variables
In-class:
  • Review of GET Form Submission
  • Passing Parameters Between Forms and Responses with URL Processing
  • Review of Hidden Form Fields
  • Overview of Cookies
  • Setting and Retrieving Cookies in PHP
  • Overview of Session Management
  • Setting and Retrieving Session Variables
  • Some Exercises that Demonstrate Skills Learned
  • Continue your implementation of Project 3 - the Ocean Picture of the Day site.


10 November

Introduction to databases (Part 1)

The on-line lecture associated with this class session is on-line here.

Goals:

  • Learn what a database is, and why it works so well with PHP
  • Learn how to create a database and some simple database tables in sqlYog
In-class:
  • Database Overview
    • Flat, Relational, Object, and Hybrid Databases
    • Database Role in the Big Picture of the Web
    • Database Tables as Columns and Rows
    • Database Records and Field Data Types
    • Structured Query Language and MySQL as one Implementation
    • Structured Query Language (SQL) Syntax
    • Preview of INSERT, UPDATE, and DELETE
  • Introduction to Project 3 - Ocean Picture of the Day (see oceanproject.org)
  • Some Exercises that Demonstrate Skills Learned

  • Create database for Project 3: A Very Simple Photo Tagging Table


17 November

Introduction to databases (Part 2)

The on-line lecture associated with this class session is on-line here.

Goals:

  • Hear about the 4 most common SQL statements (SELECT, INSERT, UPDATE, and DELETE)
  • Study the SELECT statement in detail
  • Connecting to a database in PHP
In-class:
  • Review of what PHP is good for
  • Using the phpAdmin Tool
  • Let's all use SQL to build some tables
  • Take a look at MySQL Data Types
  • Let's fill our tables with data
  • Let's integrate our data needs with PHP
  • Let's discuss the OPOD project
  • Adding a Conditional WHERE Clause to Filter Data
  • Integrating Databases with PHP Code
  • The mysql_connect() function
  • The mysql_query() function
  • Result sets, mysql_fetchArray, and while loops
  • Some Exercises that Demonstrate Skills Learned

  • Implement your picture process solution for Project 3
  • Look at the Astronomy Picture of the Day (APOD) and Earth Sciences Picture of the Day (ESPOD) examples on the Web (you can Google them)


24 November

Project 4: Putting everything together

We reviewed the code for Project 2 - the Ocean Picture Of the Day site.

Goals:

  • Learn to use forms, cookies, and our database to create a citizen science management system.
In Class:
  • Project 2 technical review
  • Review of forms, cookies, and database connections
  • All projects brainstorm (share your ideas you are not interested in implementing so someone else can)
  • Project 4 discussion - A citizen science data collection and visualization system for savethebay.org

  • Work on and/or complete Project 4
  • Creating a login form
  • Checking parameters against a database
  • Setting and checking a login cookie
  • Using Amazon's ISBN Service (if you need reinforcement of skills)


1 December

Review of Projects and Course Materials

We reviewed the code for Project 4 - the Citizen Science site.

  • This project is on our server at: /var/www/html/dynphp/bdc/std
  • I added the pictures of the critters to the form after class and made the trawl database available for you to look at in our PhpAdmin forms.
  • Note: Our final class version of the project will be posted here.
Goals:
  • Consider how all our projects demonstrate the usability and rich features base of PHP and MySQL (or any back-end database)
In-class:
  • Advanced database queries
  • Review of all our projects
  • Design review for anyone who wants feedback from class peers
  • Question and answers based on your e-mails and then questions in class
  • Review of book topics not covered explicitly yet

  • Continue working your Projects for your personal portfolio


8 December

Last Day of Class

Goals:

  • Student portfolio design review
  • Consider how the additional features of PHP listed below could be used to your advantage in building attractive and useful websites
In-class:
  • Getting Comfortable with Self-Guided Learning in PHP
The following is a brief listing of some of the topics from which students can suggest topics for our last class together. The goal is for you to feel comfortable diving in to any possible topic on your own - have you figured out your own personal process for that yet? — (the topics will be discussed and voted on during our December 1st class):
  • Introduction to regular expressions
  • Using regular expressions to extract data from text
  • Filtering incoming values based on regular expressions
  • Complex array handling
  • Using nested arrays and nested associative arrays
  • Array management functions (push, pop, split, merge, etc)
  • Array sorting
  • Complex variable usage
  • Dynamic / run-time variable names
  • Parsing variables from strings and arrays
  • Type checking and manipulation (gettype function and type casts)
  • Classes and objects in PHP
  • Advanced database queries
  • SQL JOINs and cross-referencing multiple tables in a single query
  • Sub-queries
  • Computed columns (and the GROUP BY clause)
  • PHP outside HTML
  • PHP in stylesheets
  • Command-line / Stand-alone PHP applications
  • Generating JavaScript with PHP
  • PHP and dynamic HTML
  • Creating re-usable DHTML chunks
  • Browser detection and dynamic page adaptation on the server
  • Implementing simple administrative areas
  • Security considerations
  • Managing users and permissions
  • Logging changes
  • Gathering website statistics (PHP's original use!)
  • Page views
  • Links and navigation paths
  • Entry and exit pages
  • Error handling in PHP
  • User generated errors
  • Custom error handling functions
  • Stack trace functions
  • Try-catch blocks
  • Exceptions and exception classes

  • Finish working on your Projects for your personal portfolio
Welcome to Class

File Size: 37 kb
Posted: Sun, Oct 7, 2009