spacer
Home News Links People Catalog
spacer
activepages
spacer

Spring 2011


DAY/TIME/PLACE

Starts February 28, Monday evenings, 6:30pm-9:30pm
20 Washington Place, Room 018

Instructor: Bruce Donald Campbell

Faculty, Continuing Education - RISD
Providence, RI

Technical Director, Watersheds Project
Providence, RI

Email: bcampbel01@risd.edu

Prerequisites: None                                             Class Roster

DESCRIPTION

This course provides students 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%
Homework sets - 40%
Class project - 40%

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

Course Book Companion Site.

WAMP Server home page.
MAMP home page.
Building a LAMP tutorial

SYLLABUS

Date

Topic

Assignment


28 February

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

Be sure to read the Welcome to Class page and integrate all we went over together in our first class into your approach for this class.

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

Look at the four web sites students used last class to add functionality with PHP:

Then consider how we might use PHP to improve these two sites:


7 March

Introduction to PHP

Class 2 has been canceled for tonight. Please be sure to spend time on last week's assignments and read the book with any spare time you have available to you. We will resume next week and I'll have a make-up class time for us to discuss next week as well.

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

  • Read Chapter 1 of our book


14 March

Block Statements and Conditions

In-class examples are online here and 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:

  • Start off with goals from the canceled class above
  • 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
  • Read Chapter 2 of our book


21 March

Loops and Discussion of Project Work for Class

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

In class:

  • Learn about for, do-while and while loops
  • Master the postfix increment and decrement operators
  • Discover the difference between single and double quotes
  • Introduction to the String library
  • Review of the goals of all projects and skills required to fulfill them
  • Review of the class development process and opportunity to substitute projects

  • Diagram the Virtual Gallery Code at the bottom of this week's lecture and turn in via e-mail.
  • 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.
  • Read Chapter 3 of our book


28 March

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


4 April

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


11 April

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
  • Work on Project 1.


25 April

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


2 May

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
  • 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

  • Finish Project 1 and begin work on Project 2


9 May

Project 2: Putting everything together

Goal:

To feel comfortable with adding a back-end database into an existing website

In Class:

  • Parts database tutorial completion with considerations for OPOD site
  • Work on Project 2 after considering the needs of the Community Learning Partnership
  • Using Amazon's ISBN Service (if you need reinforcement of skills)


16 May

Review of Projects and Course Materials

Goals:

  • Consider how all websites can take advantage of the usability and rich features base of PHP and MySQL (or any back-end database)
In-class:
  • We'll take a look at a php-driven citizen science site.
  • And, we'll finish the last of the parts tutorial.
  • Advanced database queries
  • Questions regarding 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
  • Continue working your Projects for your personal portfolio


23 May

Last Day of Class

Goals:

  • 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
  • Review concepts from list below (online support here)
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


30 May

Last Day of Class

Note: Our Party will take place in the 3rd Floor Conference Room in 20 Washington Place (same building, different floor). Head left when you get off the elevators and you'll see the conference room about fifty feet on your right.

Goals:
In-class:
  • Getting Comfortable with Self-Guided Learning in PHP
  • Feedback From Fellow Students and Discussion of PHP
  • Finish working on your Projects for your personal portfolio even after our class ends
Welcome to Class

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