Class:
1 ·
2 ·
3 ·
4 ·
5 ·
6 ·
7 ·
8 ·
9 ·
10 ·
11 ·
12 ·
13 ·
14
Week 1: Introduction and The Basics
Topics:
Introduction to the Class
Web Hardware and Software Basics
Setting Up Your Production Environment
Creating "Hello, World" in PHP
Resources:
Class #1 Notes
Weekly Assignment:
Pick a dynamic website you admire and write a paragraph about what you like about it. Modify your "Hello, World" program to contain that paragraph and a link to that website.
Recommended Reading/Reference:
Web Database Applications with PHP & MySQL
Pages 1-15 (Chapter 1: Database Applications and the Web)
Week 2: PHP Basics and CGI: Script-Generated Pages
Topics:
PHP Basics, Variable Types, Statements, Examples
Functions
PHP & CGI - Interacting With The Web Server
POST and GET - Obtaining and Parsing Form Input
HTML Form Widgets - An Overview
Sample PHP Template
Basic File I/O
Webpages That Constantly Change
Resources:
Class #2 Notes
Class #2 PHP Template
DWD Bookmarks about PHP
Weekly Assignment:
Using the Class #2 PHP template shown above, create a web page that changes based upon user input. Please use at least two HTML widgets in addition to your submit button, and use the input from these widgets to create something useful or interesting for the end user. Please try to make your display cohesive by imagining how and why someone might use your web page.
Recommended Reading/Reference:
Web Database Applications with PHP & MySQL
PHP Variables, Operators, Expressions, Logic Flow (pps. 16-36), Functions and Include Files (pps. 45-56), Arrays, Strings and Dates (pps. 57-71, 76-87, 97-103)
Week 3: Database Design, MySQL, and the SQL Language - Part 1
Topics:
Introduction to Databases
Relationship Modeling
Using PhpMyAdmin To Create Your First Table
MySQL Data Types
Basic SQL Commands
Resources:
Class #3 Notes
PhpMyAdmin Database Tool
DWD Bookmarks about MySQL
Weekly Assignment:
The basis of this week's assignment is to create and manipulate a table of your own creation, but also to show what you did and present it in a web page that is created by a PHP script. Thus, all SQL statements that you issue will be documented in your web page, as well as how each statement affected the data in your table. Here are more specific instructions:
- Create a table of your choosing which contains the following columns: an ID column, at least one numeric column (i.e. integer, double, or decimal), at least one string column (i.e. varchar, text, or blob), and at least one date or time column (i.e. date, time, datetime, etc). Show a visual representation of the columns of your table in your PHP-generated web page. You can use the "Print View" link on the PhpMyAdmin "Structure" page and take a snapshot of your table in PhotoShop and present it as an image, or you can cut and paste the HTML from the "Print View" link into your PHP script, or use whatever means necessary to show the structure of your table inside of your PHP-generated web page.
- Using the INSERT statement in the PhpMyAdmin SQL window, create at least 5 records.
- Inside of your PHP-generated web page, list the INSERT statements that were used to create your data set. Then show all records in your table. You can use the "Print View" link on the PhpMyAdmin "Browse" page and take a snapshot of your table in PhotoShop and present it as an image, or you can cut and paste the HTML from the "Print View" link into your PHP script, or use whatever means necessary to show the contents of your table inside of your PHP-generated web page.
- Using the SELECT statement in the PhpMyAdmin SQL window, make at three targeted queries. One should be based upon a numeric column (i.e. where id=5), one should be based upon a text query (i.e. where name='Jones') and one should be based upon a datetime column (i.e. where date>'4/1/2001'). Show each query and its respective results inside of your PHP-generated web page.
- Using the UPDATE statement in the PhpMyAdmin SQL window, change at least one of the records in your table. Show the statement and the new contents of your table inside of your PHP-generated web page.
- Using the DELETE statement in the PhpMyAdmin SQL window, remove at least one but not all of the records in your table. Show the statement and the new contents of your table inside of your PHP-generated web page.
Please try to choose your table columns and queries in some sort of coherent fashion. Think of some data in your life that you'd like to organize (address book, the weather, your CDs, etc), and how you might be able to keep track of it, and to obtain interesting results by querying it.
Recommended Reading/Reference:
Web Database Applications with PHP & MySQL
Chapter 5, SQL and MySQL, Database Basics (pps. 134-138), SELECT statements (pps. 152-160)
Teach Yourself MySQL in 21 Days By Anthony Butcher
Pages 42-46 (Relationship Modeling), 65-83 (Data Types), 109-112 (INSERT), 115-116 (UPDATE), 128-134 (SELECT), 151 (DELETE)
Week 4: Database Design, MySQL, and the SQL Language - Part 2
Topics:
Database Optimization - First 3 Forms of Normalization
Multiple-Table Queries
Advanced Single-Table Queries
MySQL Date and Time Functions
Resources:
Class #4 Notes
DWD Bookmarks about MySQL
Weekly Assignment:
Pick a raw data set of your choosing that contains at least 10 records, and normalize it through the three forms of normalization, making sure that the design changes with each step. The design of your raw data set is what will help demonstrate your knowledge of what defines each step of normalization, so choose it carefully. Your design must consist of several tables. Take snapshots of your design at each step and present them in a web page generated by PHP such that we can dissect them in class.
Recommended Reading/Reference:
An Introduction to Database Normalization By Mike Hillyer
Multiple Table Joins @ Wikipedia
Teach Yourself MySQL in 21 Days By Anthony Butcher
Pages 46-49 (Normalization), 127-139 (SELECT Queries), 156-161 (Multiple Table Queries), 188-196 (MySQL Date and Time Functions)
MySQL GROUP BY Functions
MySQL Date and Time Functions
Week 5: PHP Talks to MySQL: The Web to the Database and Back
Topics:
The PHP Interface To MySQL
Practical Considerations on Stage
Common PHP DB Methods
Example Scripts for the Four Main SQL Queries
Favorite Sites Demo
Handling One-To-Many Relationships
Handling Many-To-Many Relationships
Resources:
Class #5 Notes
Favorite Web Sites Demo - Submit & Vote
| Source Code
Favorite Web Sites Demo - Submit with Category (One to Many)
| Source Code
Favorite Web Sites Demo - Submit with Tags (Many to Many)
| Source Code
Weekly Assignment:
Create a web page that accepts user input and stores it in a table (or tables) in your database. This page should also be able to display the contents of your table(s) in some interesting way. As always, try to choose your data and functionality in some coherent fashion, paying particular attention to user interface design. Why would someone want to use this little application you've created? Why is it important that whatever activity they have performed be persistent in your database? On a more technical level, this means that PHP will have to perform at least one SELECT query, at least one INSERT query, possibly an UPDATE query, and possibly a DELETE query. However, the functionality of your interface is ultimately more inportant than the range of SQL operations it needs to perform.
Recommended Reading/Reference:
Web Database Applications with PHP & MySQL
Querying MySQL and Formatting Output (pps. 171-183), Processing User Input (pps. 190-197)
PHP/MySQL Documentation
Week 6: PHP Tricks: The Basic and The Sexy
Topics:
Redirection
Cookies
Session Management & Password-Protected Pages
Sending E-mail
Image Management
PHP and HTTP
Miscellaneous Tricks
Resources:
Class #6 Notes
Class #6 Login Demo
| Source Code
Note: To login to the demo, use the username: itpdb and the password: interact
Weekly Assignment:
Your assignment is start working on your mid-term project, which is due Oct 28th. Your mid-term project cannot be a collaborative effort with another student, as each student must show a core proficiency in the basic concepts that have been taught up to now. You will be free to collaborate on your final project if desired. The main technical requirements for the mid-term project are as follows:
- Well-architected HTML front-end demonstrating a firm grasp of form widgets
- Normalized multiple-table database design
- PHP scripting that incorporates error checking, database manipulation, and proper user feedback
Your finished project should consist of the following:
- A description page containing a paragraph explaining your project, and an image screenshot of your database design.
- A working demo. If your demo requires a login to see various functionality, then the login page should either allow for new user registration or indicate a valid username/password combination to login.
- Note: If your demo is not hosted on the ITP Stage server, then please provide links so that I can view the source code to all relevant scripts (re-saving "script.php" as "script.php.txt" and linking to the latter will accomplish this) or email them to me.
Recommended Reading/Reference:
PHP Header Function Reference
PHP Session Handling Functions
PHP Mail Function | Emailing in PHP - Reference
PHP File Upload Reference
PHP Curl Library
Regular Expressions - Perl-Compatible
Week 7: Dynamic Design: Page Layout and CSS
Week 8: Mid-Term Project Presentations
Week 9: Dynamic Web Development on the Client-Side: JavaScript, XML, and AJAX
Week 10: More Client-Side: Interfacing with Flash
Week 11: Site Architecture and Interacting with Web Services
Week 12: Dissection of Dynamic Websites: DodgeBall, Wallop, WholeNote
Week 13: Final Project Workshop
Week 14: Final Project Presentation