Web Programming Step by Step
by Marty Stepp, Jessica Miller, and Victoria Kirst
Authors' official companion web site
Main Page
Table of Contents
Sample Chapters
Supplements
Errata
Schools
Buy 2nd edition
(Why Lulu?)
Table of Contents
CHAPTER 1 THE INTERNET AND WORLD WIDE WEB
1.1 WHAT IS THE INTERNET?
History
People and Organizations
Technologies
1.2 THE WORLD WIDE WEB (WWW)
Clients and Servers
URLs and DNS
Hypertext Transmit Protocol (HTTP)
Languages of the Web
CHAPTER 2 HTML BASICS
2.1 BASIC HTML
History
Page Structure
Block Elements
Inline Elements
2.2 MORE HTML ELEMENTS
Lists
Tables
Quotations
Pre-Formatted Text
A Few Miscellaneous Elements
2.3 WEB STANDARDS
Why Follow Web Standards?
The W3C XHTML Validator
Web Page Metadata
2.4 CASE STUDY: TRAVELER TIMES
CHAPTER 3 CSS FOR STYLING
3.1 BASIC CSS
CSS Syntax
Applying CSS to a Web Page
Color Properties
CSS Comments
Font Properties
Text Properties
3.2 MORE CSS
Style Inheritance and Conflicts
IDs and ID Selectors
Classes and Class Selectors
CSS for Lists
CSS for Tables
W3C CSS Validator
3.3 CASE STUDY: TRAVELER TIMES REVISITED
Fonts and Colors
Text and List Properties
Targeting Elements with IDs and Classes
Final File Contents
CHAPTER 4 PAGE LAYOUT
4.1 STYLING PAGE SECTIONS
Page Sections (div)
Spans of Text (span)
CSS Context Selectors
4.2 INTRODUCTION TO LAYOUT
The CSS Box Model
Finding Box Model Problems with Firebug
4.3 FLOATING ELEMENTS
The float Property
The clear Property
Making Floating Elements Fit
Multi-Column Floating Layouts
4.4 SIZING AND POSITIONING
Width and Height
Positioning
Z-indexing
Element Visibility
4.5 INTERNET EXPLORER LAYOUT QUIRKS (OPTIONAL)
Workarounds for IE Flaws
4.6 CASE STUDY: ULTIMATE FRISBEE
Page Sections and General Styles
Page Layout
Final File Contents
CHAPTER 5 PHP FOR SERVER-SIDE PROGRAMMING
5.1 SERVER-SIDE BASICS
Lifecycle of a Web Request
Introduction to PHP
5.2 PHP BASIC SYNTAX
Syntax Errors
The print Statement
Types
Arithmetic
Variables
Strings
Comments
Boolean Logic
Control Statements
5.3 EMBEDDED PHP
Embedding PHP in HTML
Expression Blocks
5.4 ADVANCED PHP SYNTAX
Functions
Including Files
Arrays
The foreach Loop
File I/O
5.5 CASE STUDY: WORD OF THE DAY
Index Page
Word Definition Page
Final File Contents
CHAPTER 6 HTML FORMS AND SERVER-SIDE DATA
6.1 FORM BASICS
Parameterized Pages and Query Strings
A Simple Form
6.2 FORM CONTROLS
Text Boxes (Single-Line)
Text Areas (Multi-Line)
Checkboxes
Radio Buttons
Labels
Drop-down Menus and Lists
Reset Buttons
Grouping Controls (Field Sets)
Styling Forms
6.3 SUBMITTING DATA
URL-encoding
Hidden Input Parameters
HTTP Requests: GET vs. POST
Uploading Files
6.4 PROCESSING FORM DATA IN PHP
Superglobal Associative Arrays
Working with $_REQUEST
Processing Uploaded Files
6.5 CASE STUDY: VOCAB QUIZ
Selecting Random Words
Submitting Guesses
Final File Contents
CHAPTER 7 JAVASCRIPT FOR INTERACTIVE WEB PAGES
7.1 KEY JAVASCRIPT CONCEPTS
Client-Side Scripting
Event-Driven Programming
A JavaScript Program
The Document Object Model (DOM)
7.2 JAVASCRIPT SYNTAX
Types
Numbers and Arithmetic
Variables
Comments
Using DOM Objects
Debugging Common Errors (a.k.a., "Why Doesn't My Program Do Anything?")
Strings
for Loops
The Math Object
Null and Undefined Values
7.3 PROGRAM LOGIC
Comparison Operators
Conditional Statements: if/else
Boolean Values
Logical Operators
While Loops
7.4 ADVANCED JAVASCRIPT SYNTAX
Scope and Global Variables
Arrays
Function Parameters and Returns
Input Dialog Boxes
7.5 CASE STUDY: HANGMAN
Initial HTML/CSS Code
Choosing a Word with JavaScript
Making Guesses
Right and Wrong Guesses
Final File Contents
CHAPTER 8 THE DOCUMENT OBJECT MODEL (DOM)
8.1 GLOBAL DOM OBJECTS
window.onload and Unobtrusive JavaScript
Anonymous Functions
The Keyword this
8.2 DOM ELEMENT OBJECTS
Interacting with Text
Adjusting Styles
Unobtrusive Styling
8.3 THE DOM TREE
DOM Nodes
Traversal Properties and Methods
Traversing Elements
Selecting Groups of Elements
Creating and Removing Nodes
8.4 CASE STUDY: COLORED SQUARES
Initial HTML/CSS Code
Creating Squares
Add Squares, Change Colors
Clickable Squares
Final File Contents
CHAPTER 9 EVENTS AND THE PROTOTYPE LIBRARY
9.1 THE PROTOTYPE JAVASCRIPT LIBRARY
Introduction to Prototype
Language Improvements
Prototype and the DOM
Accessing Styles
Traversing the DOM
Prototype and Forms
9.2 EVENT-HANDLING
The Event Object
Mouse Events
Keyboard and Text Events
Form Events
Page Events
Timer Events
9.3 CASE STUDY: MULTIPLICATION QUIZ
Initial HTML/CSS Code
Problems and Guesses
Time Limits
Final File Contents
CHAPTER 10 AJAX AND XML FOR ACCESSING DATA
10.1 AJAX CONCEPTS
History and Compatibility
10.2 USING XMLHTTPREQUEST TO FETCH DATA
Synchronous Requests
Checking for Ajax Errors
Asynchronous Requests
Prototype's Ajax Features
Ajax Security and Debugging
10.3 XML
What is XML?
XML Document Structure, Schemas, and DTDs
Processing XML Data
10.4 CASE STUDY: ANIMAL GAME
Initial HTML/CSS Content
Fetching Question Data Using Ajax
End-of-Game and Adding Polish
Final File Contents
CHAPTER 11 RELATIONAL DATABASES AND SQL
11.1 DATABASE BASICS
Motivation
Example Database: imdb
11.2 SQL
Connecting to MySQL
Database/Table Information
The SELECT Statement
Filtering Results with the WHERE Clause
Ordering Results: ORDER BY
Modifying Data: INSERT, EDIT, and DELETE
11.3 INTERACTING WITH A DATABASE USING PHP
Connecting to a Database
Performing Queries
Error Checking
11.4 MULTI-TABLE QUERIES
Cartesian Product
Joins
Keys
Designing a Query
11.5 CASE STUDY: ADVENTURE RECOMMENDER
Index Page
Adventure Recommendations Page
Final File Contents
CHAPTER 12 WEB 2.0 AND SCRIPTACULOUS
12.1 DESIGNING FOR WEB 2.0
Page Layout
Navigation and Links
Forms and UI Controls
Accessibility
12.2 SCRIPTACULOUS
Visual Effects
Drag-and-Drop
Controls and Sounds
CHAPTER 13 GOING LIVE: CREATING/LAUNCHING A WEBSITE
13.1 REFINE YOUR IDEA
Talk to Your Users
Look at Your Competition
Decide on Technology
Encouragement
13.2 GET YOUR SITE ON THE INTERNET
Running a Web Server
Web Hosting
Debugging and Testing a Live Web Site
13.3 DRIVING TRAFFIC TO YOUR WEB SITE
Google AdWords
Viral Marketing
Search Engine Optimization (SEO)
PageRank
Google Analytics
13.4 MAKING MONEY
Google AdSense
Referral Programs
Banner Advertisements
Other Options
Funding Your Web Site
13.5 LEGAL ISSUES
Intellectual Property
Legal Liabilities
Security Issues
Conclusion
APPENDIX A DATABASE DESIGN
A.1 DATABASE DESIGN AND DEFINITION
Relational Database Design
Data Definition Language