COURSE GOALS: Our goal is to master web-development techniques that use databases to create content. This includes HTML form objects, database connections, and server-side programming. This semester we will focus on open-source approaches using the MySQL database, general-purpose structured query language (SQL), and PHP5 for programming on the server.
TEXTS:PHP and MySQL Web Development—Third Edition. 2005. Luke Welling and Laura Thomson. Sam's Publishing. (Note: The 4th edition, originally to be released in April 2007 (!) has been continually delayed and will not be available for use this semester. We have requested used copies of the 3rd edition at both the RI Book Company (Emporium) and the URI Book Store (Union). You may also try Amazon. We will be relying on this text from the first week and throughout the semester.)
Additional material will be provided from the course website and as handouts from the instructor.
FORMAT: We will have two lectures and two labs per week. Exercises will follow text examples and projects. Office hours are liberal and you are encouraged to take advantage of them.
GRADES: Programming assignments—in parallel with the text— will be graded. You are expected to attend and participate in all classes, to have completed assigned readings on time. A rubric for grading will be provided with each assignment. (Details)
PREREQUISITES: The course is for advanced students with career or program-related needs for Web applications training. Students should be familiar with Windows operating systems and with technology for static web pages, equivalent to COM271. Students who are deficient in client-side programming technique should discuss this with Dr. Logan, who will work with you to bring you fully up to speed (including possible evening lab instruction for 2-3 weeks, as needed).
SCHEDULE: Lecture, MW 3:00-3:50, 132 Washburn | Lab, TTh, 3:30-5:15, 215 Quinn | Office Hours
COURSE OUTLINE
PHP
Week 1 (January 23-24)
Introduction: Course goals, syllabus, and classroom procedures explained.
Review: XHTML. CSS.
Overview: PHP for server-side programming.
Forms: <form>, attributes Method and Action. <input>, <textarea>, <select>, and <option> elements. Radio buttons, checkboxes, scrolled lists, textboxes, hidden text, and submit buttons.
Reading: Chapter 1 (p. 11-55) (notes)
Programming: 1—"Setting Up"
Week 2 (January 28-31)
PHP Overview:Embedding PHP scripts with tags <?php and ?>. Accessing form variables. Identifiers. Variables (types, values). Constants. Scope. Operators. Expressions. Functions. Conditions with if, else, and switch. Iteration with while, do, and for.
Storing and Using Data:Saving data for later use. Creating, opening, reading from, writing to, and closing files. Locking and deleting files. Files versus relational databases.
Arrays: Array indices (numerical, non-numerical). Array operators. Multidimensional arrays. Sorting. Array functions.
Reading: Chapters 2, 3 (pages 57-104) (notes 2 | (notes 3)
Programming: 2—"The Grocery List"
Week 3 (February 4-7)
Strings and Regular Expressions: Formatting, joining, and splitting strings. String comparisons. Functions for matching and replacing substrings. Using regular expressions.
Functions: Reusing code. Require ( ) and include ( ). Defining functions. Using parameters. Scope. Returning values. Calling by reference (pointer); calling by value. Recursions.
Reading: Welling and Thomson, cpts. 4, 5 (pages 105-155) (notes 4 | notes 5)
Programming: Assignment 3—Error-checking and Form Feedback
Week 4 (February 11-14)
Object-oriented PHP: Concepts. Classes, attributes, and operations. Class attributes, constants, methods. Inheritance. Access modifiers. Static methods. Type hinting. Object cloning. Abstract classes. Class design. Advanced object-oriented functionality.
Exception Handling: Concepts. Try...throw...catch. Class Exception. User-defined exceptions. Other error handling methods.
MySQL
Database Design Overview: Relational database concepts and terminology. Principles and practices of database design. Normalization and de-normalization.
Reading: Welling and Thomson, cpts. 6, 7, 8 (pages 157-216) (notes 6 | notes 7 | notes 8)
Programming: Assignment 4—Object Oriented Web Programming
Week 5 (February 18-21)
Setting Up Databases: Creating a database. Setting users and privileges. Creating tables. Column types (=fields). Setting indices and primary keys.
Using the MySQL Database: SQL (Structured Query Language). Inserting and retrieving data from a table. Joining tables. Subqueries. Updating records. Deleting records. Modifying or deleting tables.
Reading: Welling and Thomson, cpts. 9, 10 (pages 205-239) (notes 9 | notes 10).
Programming: Assignment 5—Setting up a database (using phpMyAdmin)
Week 6 (February 25-28)
Database Access From PHP Web Pages: Web server communications with database server. Opening and Closing Connections. Finding and selecting available databases. Querying and retrieving query results. PEAR, an interface.
Advanced MySQL Administration: The MySQL privilege system in detail. Securing the database. Speeding up queries. Optimizing. Backup and Recovery. Replication.
Advanced MySQL Programming: The Load Data Infile statement. Transactions. Foreign keys. Stored queries / procedures.
Reading: Welling and Thomson, cpts. 11, 12, 13 (pages 265-319) (notes 11 | notes 12 | notes 13).
Programming: Assignment 6—Building a Front End
E-commerce and Security
Week 7 (March 3-6)
E-commerce Overview: Site design and goals. Alternative designs. Risks and Threats. Strategies.
E-commerce Security Issues: Securing your information. Threats. Policies. Tradeoffs (usability, performance, cost, security). Authentication. Principles and practices of encryption. Digital signatures and certificates. Secure servers. Auditing and logging. Firewalls. Backups. Physical security.
Authentication with PHP and MySQL: Identifying visitors. Controlling access. Basic authentication. Apache authentication. Custom authentication.
Reading: Welling and Thomson, cpts. 14, 15, 16 (pages 323-378) (notes 14 | notes 15 | notes 16).
Programming: Assignment 7—Back end
Advanced PHP Techniques
Week 8 (March 10-13)
Secure Transactions with PHP and MySQL: Providing secure transactions. Secure Sockets Layer (SSL). Secure storage. Storing (or not) credit card numbers. More on encryption,
Web Server File System: Uploading files. Directory functions. Interacting with server files. Executing server-side applications. Server environment variables.
Network and protocol functions: Sending and reading email. Using other websites via HTTP. Network lookup functions. FTP.
Reading: Welling and Thomson, cpts. 17, 18, 19 (pages 379-437) (notes 17 | notes 18 | notes 19).
Week 9 (March 24-27)
March 17-21 is Spring Break!
Date and Time: Getting date and time. Converting date formats. Date calculations. Calendar functions.
Images on the fly: Image support in PHP. Image formats. Creating images. Using automatically generated images on web pages. Using text and fonts to create images. Drawing figures and graphing data.
Reading: Welling and Thomson, cpts. 20, 21 (pages 439-477) (notes 20 | notes 21).
Programming: Assignment 8—Session Control
Week 10 (March 31-April 3)
PHP Sessions: Session control. Cookies. Setting up a session. Session variables. Sessions and authentication.
Miscellaneous PHP features: Magic quotes. eval( ) for strings. Terminating execution with die and exit. Serializing variables and objects. Accessing the PHP environment. PHP extensions. Highlighting source code.
Reading: Welling and Thomson, cpts. 22, 23 (pages 479-503) (notes 22 | notes 23).
Programming: Assignment 10—Authentication
Practical PHP and MySQL Projects
Week 11 (April 7-10)
Managing Large Projects: Software engineering for web development. Project planning and management. Reusable and durable coding. Development environments. Documentation. Prototypes (wireframes). Optimization. Separating content, structure, style, and programming.
Debugging: Program errors (syntax, runtime, logic). Error messages and levels. Handling errors gracefully.
Authentication and Personalization: Logging in. Authenticating users. Passwords. User preferences. Personalized content. Suggesting content based on a user profile.
Reading: Welling and Thomson, cpts. 24, 25, 26 (pages 507-578) (notes 24 | notes 25 | notes 26).
Programming: Assignment 11—Secure Transactions
Week 12 (April 14-17)
A Shopping Cart: A product database. Online categorized product catalog. Shopping cart to track purchases. Checkout script for payment and shipping. Administrative interface.
Content Management: Developing web pages that use a series of templates. Building a search engine that uses metadata.
Reading: Welling and Thomson, cpts. 27, 28 (pages 579-655) (notes 27 | notes 28).
Week 13 (April 21-24)
Web-based Email: Connecting to POP3 and IMAP mail servers. Reading and sending mail. Replying to and forwarding mail. Deleting mail from an account.
Web Services with XML and SOAP: XML and SOAP basics. Using XML to communicate with Amazon. Parsing XML. Caching responses. Talking to Amazon with NuSOAP.
Reading: Welling and Thomson, cpts. 29, 33 (pages 657-693, 819-864) (notes 29 | notes 33).
Week 14 (April 28-29)
Tuesday, April 29, is the last day of classes!
Wrapping Up: Review and SETs.
Final Exam, TBA.