Contents
Fundamentals of Web Development
Fundamentals of Web Development
Brief Table of Contents
Table of Contents
Preface
What Is Web Development?
What’s New in the Third Edition?
Features of the Book
Organization of the Book
Pathways through this Book
For the Instructor
For the Student
Why This Book?
Visual Walkthrough
1
Introduction to Web Development
Chapter Objectives
1.1
A Complicated Ecosystem
1.2
Definitions and History
1.2.1
A Short History of the Internet
1.2.2
The Birth of the Web
1.2.3
Web Applications in Comparison to Desktop Applications
1.2.4
From Static to Dynamic (and Back to Static)
1.3
The Client-Server Model
1.3.1
The Client
1.3.2
The Server
1.3.3
Server Types
1.3.4
Real-World Server Installations
1.3.5
Cloud Servers
1.4
Where Is the Internet?
1.4.1
From the Computer to Outside the Home
1.4.2
From the Home to the Ocean’s Edge
1.4.3
How the Internet Is Organized Today
1.5
Working in Web Development
1.5.1
Roles and Skills
Hardware Architect/Network Architect/Systems Engineer
System Administrator
Database Administrator/Data Architect
Security Specialist/Consultant/Expert
Developer/Programmer
Front-End Developer/UX Developer
Software Engineer
UX Designer/UI Designer/Information Architect
Tester/Quality Assurance
SEO Specialist
Content Strategists/Marketing Technologist
Project Manager/Product Manager
Business Analyst
Nontechnical Roles
1.5.2
Types of Web Development Companies
Hosting Companies
Design Companies
Website Solution Companies
Vertically Integrated Companies
Start-Up Companies
Internal Web Development
1.6
Chapter Summary
1.6.1
Key Terms
1.6.2
Review Questions
1.6.3
References
2
How the Web Works
Chapter Objectives
2.1
Internet Protocols
2.1.1
A Layered Architecture
2.1.2
Link Layer
2.1.3
Internet Layer
2.1.4
Transport Layer
2.1.5
Application Layer
2.2
Domain Name System
2.2.1
Name Levels
2.2.2
Name Registration
2.2.3
Address Resolution
2.3
Uniform Resource Locators
2.3.1
Protocol
2.3.2
Domain
2.3.3
Port
2.3.4
Path
2.3.5
Query String
2.3.6
Fragment
2.4
Hypertext Transfer Protocol
2.4.1
Headers
2.4.2
Request Methods
2.4.3
Response Codes
2.5
Web Browsers
2.5.1
Fetching a web page
2.5.2
Browser Rendering
2.5.3
Browser Caching
2.5.4
Browser features
2.5.5
Browser Extensions
2.6
Web Servers
2.6.1
Operating Systems
2.6.2
Web Server Software
2.6.3
Database Software
2.6.4
Scripting Software
2.7
Chapter Summary
2.7.1
Key Terms
2.7.2
Review Questions
2.7.3
References
3
Introduction
Chapter Objectives
3.1
What Is HTML and Where Did It Come From?
3.1.1
XHTML
3.1.2
HTML5
3.2
HTML Syntax
3.2.1
Elements and Attributes
3.2.2
Nesting HTML Elements
3.3
Semantic Markup
3.4
Structure of HTML Documents
3.4.1
Doctype
3.4.2
Head and Body
3.5
Quick Tour of HTML Elements
3.5.1
Headings
3.5.2
Paragraphs and Divisions
3.5.3
Links
3.5.4
URL Relative Referencing
3.5.5
Inline Text Elements
3.5.6
Images
3.5.7
Character Entities
3.5.8
Lists
3.6
HTML5 Semantic Structure Elements
3.6.1
Header and Footer
3.6.2
Navigation
3.6.3
Main
3.6.4
Articles and Sections
3.6.5
Figure and Figure Captions
3.6.6
Aside
3.6.7
Details and Summary
3.6.8
Additional Semantic Elements
3.7
Chapter Summary
3.7.1
Key Terms
3.7.2
Review Questions
3.7.3
Hands-On Projects
Project 1: Simple Single Page
Difficulty Level: Beginner
Overview
Instructions
Guidance and Testing
Project 2: Using Semantic Elements
Difficulty Level: Beginner
Overview
Instructions
Guidance and Testing
Project 3: HTML Site
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
4
CSS 1: Selectors and Basic Styling
Chapter Objectives
4.1
What Is CSS?
4.1.1
Benefits of CSS
4.1.2
CSS Versions
4.1.3
Browser Adoption
4.2
CSS Syntax
4.2.1
Selectors
4.2.2
Properties
4.2.3
Values
4.3
Location of Styles
4.3.1
Inline Styles
4.3.2
Embedded Style Sheet
4.3.3
External Style Sheet
4.4
Selectors
4.4.1
Element Selectors
4.4.2
Class Selectors
4.4.3
Id Selectors
4.4.4
Attribute Selectors
4.4.5
Pseudo-Element and Pseudo-Class Selectors
4.4.6
Contextual Selectors
4.5
The Cascade: How Styles Interact
4.5.1
Inheritance
4.5.2
Specificity
4.5.3
Location
4.6
The Box Model
4.6.1
Block versus Inline Elements
4.6.2
Background
4.6.3
Borders and Box Shadow
4.6.4
Margins and Padding
4.6.5
Box Dimensions
4.7
CSS Text Styling
4.7.1
Font Family
4.7.2
Font Sizes
4.7.3
Font Weight
4.7.4
Paragraph Properties
4.8
CSS Frameworks and Variables
4.8.1
What is a CSS Framework?
4.8.2 CSS Variables
4.9
Chapter Summary
4.9.1
Key Terms
4.9.2
Review Questions
4.9.3
Hands-On Practice
Project
1:
Simple Styling
Difficulty Level: Beginner
Overview
Instructions
Guidance and Testing
Project
2:
Using Boxes
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project
3:
Home Page Prototype
Difficulty Level: Advanced
Overview
Instructions
Guidance and Testing
4.9.4
References
5
HTML 2: Tables and Forms
Chapter Objectives
5.1
HTML Tables
5.1.1
Basic Table Structure
5.1.2
Spanning Rows and Columns
5.1.3
Additional Table Elements
5.1.4
Using Tables for Layout
5.2
Styling Tables
5.2.1
Table Borders
5.2.2
Boxes and Zebras
5.3
Introducing Forms
5.3.1
Form Structure
5.3.2
How Forms Work
5.3.3
Query Strings
5.3.4
The
<form>
Element
5.4
Form Control Elements
5.4.1
Text Input Controls
5.4.2
Choice Controls
Select Lists
Radio Buttons
Checkboxes
5.4.3
Button Controls
5.4.4
Specialized Controls
Number and Range
Color
5.4.5
Date and Time Controls
5.5
Table and Form Accessibility
5.5.1
Accessible Tables
5.5.2
Accessible Forms
5.6
Styling and Designing Forms
5.6.1
Styling Form Elements
5.6.2
Form Design
5.7
Validating User Input
5.7.1
Types of Input Validation
5.7.2
Notifying the User
5.7.3
How to Reduce Validation Errors
5.7.4
Where to Perform Validation
5.8
Chapter Summary
5.8.1
Key Terms
5.8.2
Review Questions
5.8.3
Hands-On Practice
Project
1:
Book Rep Customer Relations Management
difficulty level: Beginners
Overview
Instructions
Guidance and Testing
Project
2:
Art Store
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project
3:
Share Your Travel Photos
Difficulty Level: Intermediate
Overview
Guidance and Testing
6
Web Media
Chapter Objectives
6.1
Representing Digital Images
6.1.1
Image Types
6.1.2
Color Models
RGB
CMYK
HSL
Opacity
Gradients
6.2
Image Concepts
6.2.1
Color Depth
6.2.2
Image Size
6.2.3
Display Resolution
6.3
File Formats
6.3.1
JPEG
6.3.2
GIF
8-Bit or Less Color
Transparency
Animation
6.3.3
PNG
6.3.4
SVG
6.3.5
Other Formats
6.4
Audio and Video
6.4.1
Media Concepts
6.4.2
Browser Video Support
6.4.3
Browser Audio Support
6.5
Working with Color
6.5.1
Picking Colors
6.5.2
Define Shades
6.6
Chapter Summary
6.6.1
Key Terms
6.6.2
Review Questions
6.6.3
Hands-On Practice
Project
1:
Resizing
Difficulty Level: Basic
Overview
Instructions
Testing
Project
2:
Art Store
Difficulty Level: Intermediate
Overview
Instructions
Testing
Project
3:
Share Your Travel Photos
Difficulty Level: Intermediate
Overview
Instructions
Testing
7
CSS 2: Layout
Chapter Objectives
7.1
Older Approaches to CSS Layout
7.1.1
Floating Elements
7.1.2
Positioning Elements
7.1.3
Overlapping and Hiding Elements
7.2
Flexbox Layout
7.2.1
Flex Containers and Flex Items
7.2.2
Use Cases for Flexbox
7.3
Grid Layout
7.3.1
Specifying the Grid Structure
7.3.2
Explicit Grid Placement
7.3.3
Cell Properties
7.3.4
Nested Grids
7.3.5
Grid Areas
7.3.6
Grid and Flexbox Together
7.4
Responsive Design
7.4.1
Setting Viewports
7.4.2
Media Queries
7.4.3
Scaling Images
7.5
CSS Effects
7.5.1
Transforms
7.5.2
Filters
7.5.3
Transitions
7.5.4
Animations
7.6
CSS Preprocessors
7.6.1
The Basics of Sass
Variables and Types
Nesting
7.6.2
Mixins and Functions
7.6.3
Modules
7.7
Chapter Summary
7.7.1
Key Terms
7.7.2
Review Questions
7.7.3
Hands-On Practice
Project 1: Book CRM
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 2: Difficulty Level: Intermediate
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 3: CSS Grid
Difficulty Level: Advanced
Overview
Instructions
Guidance and Testing
7.7.4
References
8
JavaScript 1: Language Fundamentals
Chapter Objectives
8.1
What Is JavaScript and What Can It Do?
8.1.1
Client-Side Scripting
8.1.2
JavaScript’s History
8.1.3
JavaScript and Web 2.0
8.1.4
JavaScript in Contemporary Software Development
8.2
Where Does JavaScript Go?
8.2.1
Inline JavaScript
8.2.2
Embedded JavaScript
8.2.3
External JavaScript
8.2.4
Users without JavaScript
The
<NoScript>
Tag
8.3
Variables and Data Types
8.3.1
JavaScript Output
8.3.2
Data Types
8.3.3
Built-In Objects
8.3.4
Concatenation
8.4
Conditionals
8.4.1
Truthy and Falsy
8.5
Loops
8.5.1
While and do . . . while Loops
8.5.2
For Loops
8.6
Arrays
8.6.1
Iterating an array using for . . . of
8.6.2
Array Destructuring
8.7
Objects
8.7.1
Object Creation Using Object Literal Notation
8.7.2
Object Creation Using Object Constructor
8.7.3
Object Destructuring
Spread Syntax and Object Destructuring
8.7.4
JSON
8.8
Functions
8.8.1
Function Declarations vs. Function Expressions
Default Parameters
Rest Parameters
8.8.2
Nested Functions
8.8.3
Hoisting in JavaScript
8.8.4
Callback Functions
8.8.5
Objects and Functions Together
8.8.6
Function Constructors
8.8.7
Arrow Syntax
Should I Use Arrow Functions?
Changes to “this” in Arrow Functions
8.9
Scope and Closures in JavaScript
8.9.1
Scope in JavaScript
Block Scope
Global Scope
Function/Local Scope
Globals by Mistake
8.9.2
Closures in JavaScript
8.10
Chapter Summary
8.10.1
Key Terms
8.10.2
Review Questions
8.10.3
Hands-On Practice
Project 1: Art Store
Difficulty Level: Beginner
Overview
Instructions
Test
Project 2: Photo Sharing Site
Difficulty Level: Intermediate
Overview
Instructions
Test
Project 3: Stocks
Difficulty Level: Intermediate
Overview
Instructions
Test
8.10.4
References
9
JavaScript 2: Using JavaScript
Chapter Objectives
9.1
The Document Object Model (DOM)
9.1.1
Nodes and NodeLists
9.1.2
Document Object
9.1.3
Selection Methods
9.1.4
Element Node Object
9.2
Modifying the DOM
9.2.1
Changing an Element’s Style
9.2.2
InnerHTML vs textContent vs DOM Manipulation
9.2.3
DOM Manipulation Methods
9.2.4
DOM Timing
9.3 Events
9.3.1
Implementing an Event Handler
9.3.2
Page Loading and the DOM
9.3.3
Event Object
9.3.4
Event Propagation
9.3.5
Event Delegation
9.3.6
Using the Dataset Property
9.4
Event Types
9.4.1
Mouse Events
9.4.2
Keyboard Events
9.4.3
Form Events
9.4.4
Media Events
9.4.5
Frame Events
9.5
Forms in JavaScript
9.5.1
Responding to Form Movement Events
9.5.2
Responding to Form Changes Events
9.5.3
Validating a Submitted Form
Empty Field Validation
Number Validation
9.5.4
Submitting Forms
9.6
Regular Expressions
9.6.1
Regular Expression Syntax
9.6.2
Extended Example
9.7
Chapter Summary
9.7.1
Key Terms
9.7.2
Review Questions
9.7.3
Hands-On Practice
Project 1: Enhanced Media Player
Difficulty Level: Beginner
Overview
Instructions
Test
Project 2: Painting Viewer
Difficulty Level: Intermediate
Overview
Instructions
Test
Project 3: Stock Portfolio Dashboard
Difficulty Level: Advanced
Overview
Instructions
Test
9.
7.4 References
10
JavaScript 3: Additional Features
Chapter Objectives
10.1
Array Functions
10.1.1
forEach
10.1.2
Find, Filter, Map, and Reduce
Find
Filter
Map
Reduce
10.1.3
Sort
10.2
Prototypes, Classes, and Modules
10.2.1
Using Prototypes
Using Prototypes to Extend Other Objects
10.2.2
Classes
Extending a Class
10.2.3
Modules
10.3
Asynchronous Coding with JavaScript
10.3.1
Fetching Data from a Web API
Checking for Errors
Common Mistakes with Fetch
Multiple Fetches
Cross-Origin Resource Sharing
Fetching Using Other HTTP Methods
Adding a Loading Animation
10.3.2
Promises
Creating a Promise
Working with Multiple Promises
10.3.3
Async and Await
10.4
Using Browser APIs
10.4.1
Web Storage API
10.4.2
Web Speech API
10.4.3
GeoLocation
10.5
Using External APIs
10.5.1
Google Maps
10.5.2
Charting with Plotly.js
10.6
Chapter Summary
10.6.1
Key Terms
10.6.2
Review Questions
10.6.3
Hands-On Practice
Project 1: Text Viewer
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 2: Text Viewer
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 3: Stock Dashboard
Difficulty Level: Advanced
Overview
Instructions
Guidance and Testing
10.6.4
References
11
JavaScript 4: React
Chapter Objectives
11.1
JavaScript Front-End Frameworks
11.1.1
Why Do We Need Frameworks?
11.1.2
React, Angular, and Vue
11.2
Introducing React
11.2.1
React Components
Functional Components
Class Components
11.3
Props, State, Behavior, and Forms
11.3.1
Props
Passing Complex Objects via Props
11.3.2
State
11.3.3
Behaviors
Event Handling in Class Components
Passing Data to Event Handlers
Event-Driven Conditional Rendering
Using Hooks for State
11.3.4
Forms in React
Controlled Form Components
Uncontrolled Form Components
11.3.5
Component Data Flow
11.4
React Build Approach
11.4.1
Build Tools
11.4.2
Create React App
Overview
11.4.3
Other React Build Approaches
11.5
React Lifecycle
11.5.1
Fetching Data
11.6
Extending React
11.6.1
Routing
11.6.2
CSS in React
11.6.3
Other Approaches to State
Context Provider
React Redux
11.7
Chapter Summary
11.7.1
Key Terms
11.7.2
Review Questions
11.7.3
Hands-On Practice
Project 1: Editor
Difficulty Level: Beginner
Overview
Instructions
Guidance and Testing
Project 2: Favorites List
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 3: Stock Dashboard
Difficulty Level: Advanced
Overview
Instructions
Guidance and Testing
11.7.4
References
12
Server-Side Development 1: PHP
Chapter Objectives
12.1
What Is Server-Side Development?
12.1.1
Front End versus Back End
12.1.2
Common Server-Side Technologies
12.2
PHP Language Fundamentals
12.2.1
PHP Tags
PHP Comments
12.2.2
Variables and Data Types
12.2.3
Writing to Output
12.2.4
Concatenation
printf
12.3
Program Control
12.3.1
if . . . else
12.3.2
switch . . . case
12.3.3
while and do . . . while
12.3.4
for
12.3.5
Alternate Syntax for Control Structures
12.3.6
Include Files
Scope within Include Files
12.4
Functions
12.4.1
Function Syntax
12.4.2
Invoking a Function
12.4.3
Parameters
Parameter Default Values
Passing Parameters by Reference
Parameter-Type Declarations
12.4.4
Variable Scope within Functions
12.5
Arrays
12.5.1
Defining and Accessing an Array
12.5.2
Multidimensional Arrays
12.5.3
Iterating through an Array
12.5.4
Adding and Deleting Elements
Checking if a Value Exists
12.6
Classes and Objects
12.6.1
Terminology
12.6.2
Defining Classes
12.6.3
Instantiating Objects
12.6.4
Properties
12.6.5
Constructors
12.6.6
Method
12.6.7
Visibility
12.6.8
Static Members
12.6.9
Inheritance
Referencing Base Class Members
12.7
$_GET and $_POST Superglobal Arrays
12.7.1
Superglobal Arrays
12.7.2
Determining If Any Data Sent
12.7.3
Accessing Form Array Data
12.7.4
Using Query Strings in Hyperlinks
12.7.5
Sanitizing Query Strings
12.8
Working with the HTTP Header
12.8.1
Redirecting Using Location Header
12.8.2
Setting the Content-Type Header
Returning JSON Data
Outputting Custom Images
12.9
Chapter Summary
12.9.1
Key Terms
12.9.2
Review Questions
12.9.3
Hands on Practice
Project 1: Arrays
Difficulty Level: Beginner
Overview
Instructions
Guidance and Testing
Project 2: Form and Response
Difficulty Level: Beginner
Overview
Instructions
Guidance and Testing
Project 3: Working with HTTP Headers
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
12.9.4
Reference
13
Server-Side Development 2: Node.js
Chapter Objectives
13.1
Introducing Node.js
13.1.1
Node Advantages
JavaScript Everywhere
Push Architectures
Nonblocking Architectures
Rich Ecosystem of Tools and Code
Broad Adoption
13.1.2
Node Disadvantages
13.2
First Steps with Node
13.2.1
Simple Node Application
13.2.2
Adding Express
13.2.3
Environment Variables
13.3
Creating an API in Node
13.3.1
Simple API
13.3.2
Adding Routes
13.3.3
Separating Functionality into Modules
13.4
Creating a CRUD API
13.4.1
Passing Data to an API
13.4.2
API Testing Tools
13.5
Working with Web Sockets
13.6
View Engines
13.7
Serverless Approaches
13.7.1
What Is Serverless?
13.7.2
Benefits of Serverless Computing
13.7.3
Serverless Technologies
Databases-as-a-Service
Platform-as-a-Service
Functions-as-a-Service
13.8
Chapter Summary
13.8.1
Key Terms
13.8.2
Review Questions
13.8.3
Hands-On Practice
Project 1
Difficulty Level: Beginner
Overview
Instructions
Guidance and Testing
Project 2
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 3
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
13.8.4
References
14
Working with Databases
Chapter Objectives
14.1
Databases and Web Development
14.1.1
The Role of Databases in Web Development
14.2
Managing Databases
14.2.1
Command-Line Interface
14.2.2
phpMyAdmin
14.2.3
MySQL Workbench
14.2.4
SQLite Tools
14.2.5
MongoDB Tools
14.3
SQL
14.3.1
Database Design
14.3.2
SELECT
Statement
14.3.3
INSERT
,
UPDATE
, and
DELETE
Statements
14.3.4
Transactions
Local Transactions
Distributed Transactions
14.3.5
Data Definition Statements
14.3.6
Database Indexes and Efficiency
14.4
Working with SQL in PHP
14.4.1
Connecting to a Database
Storing Connection Details
14.4.2
Handling Connection Errors
PDO Exception Modes
14.4.3
Executing the Query
14.4.4
Processing the Query Results
Fetching into an Object
14.4.5
Freeing Resources and Closing Connection
14.4.6
Working with Parameters
Sanitizing User Data
Prepared Statements
14.4.7
Using Transactions
14.4.8
Designing Data Access
14.5
NoSQL Databases
14.5.1
Why (and Why Not) Choose NoSQL?
14.5.2
Types of NoSQL Systems
Key-Value Stores
Document Stores
Column Stores
Graph Stores
14.6
Working with MongoDB in Node
14.6.1
MongoDB Features
14.6.2
MongoDB Data Model
14.6.3
Working with the MongoDB Shell
14.6.4
Accessing MongoDB Data in Node.js
14.7
Chapter Summary
14.7.1
Key Terms
14.7.2
Review Questions
14.7.3
Hands-On Practice
Project 1: Share Your Travel Photos
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 2
Difficulty Level: Intermediate
Overview
Instructions
Test
Project 3
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
14.7.4
References
15
Managing State
Chapter Objectives
15.1
The Problem of State in Web Applications
15.2
Passing Information in HTTP
15.2.1
Passing Information via the URL
15.2.2
Passing Information via HTTP Header
15.3
Cookies
15.3.1
How Do Cookies Work?
15.3.2
Using Cookies in PHP
15.3.3
Using Cookies in Node and Express
15.3.4
Persistent Cookie Best Practices
15.4
Session State
15.4.1
How Does Session State Work?
15.4.2
Session Storage and Configuration
15.4.3
Session State in PHP
15.4.4
Session State in Node
15.5
Caching
15.5.1
Page Output Caching
15.5.2
Application Data Caching
15.5.3
Redis as Caching Service
15.6
Chapter Summary
15.6.1
Key Terms
15.6.2
Review Questions
15.6.3
Hands-On Practice
Project
1:
Cookies
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project
2:
Art Store
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
15.6.4
References
16
Security
Chapter Objectives
16.1
Security Principles
16.1.1
Information Security
The CIA Triad
Security Standards
16.1.2
Risk Assessment and Management
Actors, Impacts, Threats, and Vulnerabilities
Assessing Risk
16.1.3
Security Policy
16.1.4
Business Continuity
Admin Password Management
Backups and Redundancy
Geographic Redundancy
Stage Mock Events
Auditing
16.1.5
Secure by Design
Code Reviews
Unit Testing
Pair Programming
Security Testing
Secure by Default
16.1.6
Social Engineering
16.1.7
Authentication Factors
Single versus Multifactor Authentication
16.2
Approaches to Web Authentication
16.2.1
Basic HTTP Authentication
16.2.2
Form-Based Authentication
16.2.3
HTTP Token Authentication
16.2.4
Third-Party Authentication
OAuth
16.3
Cryptography
16.3.1
Substitution Ciphers
Caesar
Modern Block Ciphers
16.3.2
Public Key Cryptography
Diffie-Hellman Key Exchange
RSA
16.3.3
Digital Signatures
16.4
Hypertext Transfer Protocol Secure (HTTPS)
16.4.1
SSL/TLS Handshake
16.4.2
Certificates and Authorities
Domain-Validated (DV) Certificates
Organization-Validated (OV) Certificates
Extended-Validation (EV) Certificates
16.4.3
Migrating to HTTPS
Mixed Content
Redirects from Old Site
Preventing HTTP Access
16.5
Security Best Practices
16.5.1
Credential Storage
Using a Hash Function
Salting the Hash
Using a Slow Hash Function
16.5.2
Monitor Your Systems
System Monitors
Access Monitors
Automated Intrusion Blocking
16.5.3
Audit and Attack Thyself
16.6
Common Threat Vectors
16.6.1
Brute-Force Attacks
16.6.2
SQL Injection
Sanitize Input
Least Possible Privileges
16.6.3
Cross-Site Scripting (XSS)
Reflected XSS
Stored XSS
Filtering User Input
Escape Dangerous Content
16.6.4
Cross-Site Request Forgery (CSRF)
16.6.5
Insecure Direct Object Reference
16.6.6
Denial of Service
Distributed DoS Attack (DDoS)
16.6.7
Security Misconfiguration
Out-of-Date Software
Open Mail Relays
More Input Attacks
Virtual Open Mail Relay
Arbitrary Program Execution
16.7
Chapter Summary
16.7.1
Key Terms
16.7.2
Review Questions
16.7.3
Hands-On Practice
Project
1:
Exploit Testing and Repair
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project
2:
PHP Security
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 3: Node Security
Difficulty Level: Advanced
Overview
Instructions
Guidance and Testing
16.7.4
References
17
DevOps and Hosting
Chapter Objectives
17.1
DevOps: Development and Operations
17.1.1
Continuous Integration, Delivery, and Deployment
17.1.2
Testing
17.1.3
Infrastructure as Code
17.1.4
Microservice architecture
17.2
Domain Name Administration
17.2.1
Registering a Domain Name
WHOIS
Private Registration
17.2.2
Updating the Name Servers
Checking Name Servers
17.2.3
DNS Record Types
Mapping Records
Mail Records
Authoritative Records
Validation Records
17.2.4
Reverse DNS
17.3
Web Server Hosting Options
17.3.1
Shared Hosting
Simple Shared Hosting
Virtualized Shared Hosting
17.3.2
Dedicated Hosting
17.3.3
Collocated Hosting
In-house Hosting
17.3.4
Cloud Hosting
17.4
Virtualization
17.4.1
Server Virtualization
Containers
17.4.2
Cloud Virtualization
17.5
Linux and Web Server Configuration
17.5.1
Configuration
17.5.2
Starting and Stopping the Server
Applying Configuration Changes
17.5.3
Connection Management
Ports
17.5.4
Data Compression
17.5.5
Encryption and SSL
17.5.6
Managing File Ownership and Permissions
17.6
Request and Response Management
17.6.1
Managing Multiple Domains on One Web Server
17.6.2
Handling Directory Requests
17.6.3
Responding to File Requests
17.6.4
URL Redirection
Public Redirection
Internal Redirection
Conditional URL Rewriting
17.6.5
Managing Access with .htaccess
17.6.6
Server Caching
17.7
Web Monitoring
17.7.1
Internal Monitoring
Webserver Logging
Log Rotation
17.7.2
External Monitoring
17.8
Chapter Summary
17.8.1
Key Terms
17.8.2
Review Questions
17.8.3
Hands-On Practice
Project 1: Register a Domain and Setup Hosting
Difficulty Level: Easy
Overview
Instructions
Guidance and Testing
Project 2: Configure DNS for a Mail Server
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
17.8.4
References
18
Tools and Traffic
Chapter Objectives
18.1
The History and Anatomy of Search Engines
18.1.1
Search Engine Overview
18.2
Web Crawlers and Scrapers
18.2.1
Scrapers
URL Scrapers
Email Scrapers
Vulnerablity Scrapers
Word Scrapers
18.3
Indexing and Reverse Indexing
18.4
PageRank and Result Order
18.5
Search Engine Optimization
18.5.1
Title
18.5.2
Meta Tags
Http-Equiv
Description
Robots
18.5.3
URLs
Bad SEO URLs
Descriptive Path Components
Descriptive File Names or Folders
Apache Redirection
18.5.4
Site Design
Website Structure
18.5.5
Sitemaps
18.5.6
Anchor Text
18.5.7
Images
18.5.8
Content
18.5.9
Black-Hat SEO
Keyword Stuffing
Hidden Content
Paid Links
Doorway Pages
Hidden Links
Comment Spam
Link Farms
Link Pyramids
Google Bombing
Cloaking
Duplicate Content
18.6
Social Networks
18.6.1
How Did We Get Here?
Early Digital Networking
The Evolution of Social Networks
18.7
Social Network Integration
18.7.1
Basic Social Media Presence
Home Pages
Links and Logos
URL Shortening
18.7.2
Facebook’s Social Plugins
Register and Plugin
Like Button
XFBML
Follow Button
Comment Stream
18.7.3
Open Graph
Open Graph Meta Tags
18.7.4
Twitter’s Widgets
Tweet This Button
Follow Me Button
Twitter Timeline
18.7.5
Advanced Social Network Integration
18.8
Content Management Systems
18.8.1
Components of a Managed Website
18.8.2
Types of CMS
18.9
WordPress Overview
18.9.1
Post and Page Management
18.9.2
WYSIWYG Editors
18.9.3
Template Management
18.9.4
Menu Control
18.9.5
User Management and Roles
18.9.6
User Roles
Content Creator
Content Publisher
Site Manager
Super Administrator
WordPress Roles
18.9.7
Workflow and Version Control
18.9.8
Asset Management
18.9.9
Search
18.9.10
Upgrades and Updates
18.10
WordPress Technical Overview
18.10.1
Installation
18.10.2
File Structure
Multiple Sites with One WordPress Installation
18.10.3
WordPress Nomenclature
Plugins
18.10.4
WordPress Template Hierarchy
18.11
Modifying Themes
18.11.1
Changing Theme Files
Tinkering with a Footer
18.12
Web Advertising Fundamentals
18.12.1
Web Advertising 101
Ad Networks
Ad Types
Creating Ads
18.12.2
Web Advertising Economy
Web Advertising Commodities
Web Commodity Markets
18.13
Support Tools and Analytics
18.13.1
Search Engine Webmaster Tools
18.13.2
Analytics
Metrics
Internal Analytics
18.13.3
Third-Party Analytics
Flow Analysis
18.13.4
Performance Tuning and Rating
Performance (Speed)
Accessibility
Seo
Best Practices
18.14
Chapter Summary
18.14.1
Key Terms
18.14.2
Review Questions
18.14.3
Hands-On Practice
Project 1: Optimize the Art Store Site for Search Engines
Difficulty Level: Easy
Overview
Instructions
Guidance and Testing
Project 2: Integrate with Social Widgets
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
Project 3: Convert Your Project to WordPress
Difficulty Level: Intermediate
Overview
Instructions
Guidance and Testing
18.14.4
References
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Z
Credits
List of Figures
The figure shows two pages from a textbook, with detailed descriptions.
The figure shows two pages from a textbook, with detailed descriptions.
The figure shows three pages from a textbook, with detailed descriptions.
The figure shows two pages from a textbook with detailed description.
Figure 1.1: The web development ecosystem
Figure 1.2: The web as a subset of the Internet
Figure 1.3: Telephone network as example of circuit switching
Figure 1.4: Internet network as example of packet switching
Figure 1.5: Intranet versus Internet
Figure 1.6: Static website (first generation)
Figure 1.7: Dynamic Server-Side website
Figure 1.8: Why are programs needed
Figure 1.9: Dynamic websites today
Figure 1.10: Static websites today
Figure 1.11: Evolving complexity in web applications
Figure 1.12: Peer-to-peer model
Figure 1.13: Different types of server
Figure 1.14: Server farm
Figure 1.15: Sample server rack
Figure 1.16: Hypothetical data center
Figure 1.17: Benefits of Content Delivery Networks
Figure 1.18: Cloud servers
Figure 1.19: Internet hardware from the home computer to the local Internet provider
Figure 1.20: Cable types
Figure 1.21: From the home to the ocean’s edge
Figure 1.22: The figure describes global network infrastructure.
Figure 1.23: The figure illustrates a relationship between networks.
Figure 1.24: Sample ISP peering
Figure 1.25: Web development roles and skills
Figure 1.26: Web development companies
Figure 1.27: The Github website
Figure 2.1: Four-layer network model
Figure 2.2: IPv4 and IPv6 comparison
Figure 2.3: Port address translation
Figure 2.4: TCP packets
Figure 2.5: Different approaches to uploading files
Figure 2.6: DNS overview
Figure 2.7: Domain levels
Figure 2.8: Domain name registration process
Figure 2.9: Domain name address resolution process
Figure 2.10: URL components
Figure 2.11: Query string components
Figure 2.12: HTTP illustrated
Figure 2.13: User-Agent components
Figure 2.14: GET versus POST requests
Figure 2.15: Browser parsing HTML and making subsequent requests
Figure 2.16: Visualizing the key events in the rendering timeline for a website
Figure 2.17: Illustration of browser caching, using cached resources
Figure 3.1 : HTML timeline
Figure 3.2 : Sample ad-hoc markup languages
Figure 3.3 : W3C markup validation service
Figure 3.4 : The parts of an HTML element
Figure 3.5 : HTML document outline
Figure 3.6 : Correct and incorrect ways of nesting HTML elements
Figure 3.7 : Visualizing structure
Figure 3.8 : One of the simplest possible HTML5 documents
Figure 3.9 : Structure elements of an HTML5 document
Figure 3.10 : Sample HTML5 document
Figure 3.11 : Figure 3.10 in the browser
Figure 3.12 : Example document outlines
Figure 3.13 : Alternate CSS stylings of the same heading
Figure 3.14 : Two parts of a link
Figure 3.15 : Different link destinations
Figure 3.16 : Using <div> elements to create a complex layout
Figure 3.17 : Example site directory tree
Figure 3.18 : The <img> element
Figure 3.19 : List elements and their default rendering
Figure 3.20 : Completed Test Your Knowledge #1
Figure 3.21 : Sample <div>-based XHTML layout (with HTML5 equivalents)
Figure 3.22 : Visualizing semantic structure
Figure 3.23 : Sample layout using new HTML5 semantic structure elements
Figure 3.24 : Articles and sections
Figure 3.25 : The figure and figcaption elements in the browser
Figure 3.26 : The details and summary elements
Figure 3.27 : A WYSIWYG editor [Adobe Dreamweaver]
Figure 3.28 : A Code Editor [Sublime Text]
Figure 3.29 : A full IDE [Eclipse]
Figure 3.30 : Cloud-Based Environment [CodeAnywhere]
Figure 3.31 : Code Playground [CodePen]
Figure 3.32 : Completed Project 1
Figure 3.33 : Completed Project 2
Figure 3.34 : Completed Project 3
Figure 4.1: CSS-based responsive design
Figure 4.2: CSS syntax
Figure 4.3: Document outline/tree
Figure 4.4: Id and class selector example
Figure 4.5: Attribute selector example
Figure 4.6: Styling a link using pseudo-class selectors
Figure 4.7: Syntax of a descendant selection
Figure 4.8: Contextual selectors in action
Figure 4.9: Browser DevTools
Figure 4.10: Completed Test Your Knowledge #1
Figure 4.11: Inheritance
Figure 4.12: More inheritance
Figure 4.13: Using the inherit value
Figure 4.14: Specificity
Figure 4.15: Specificity algorithm
Figure 4.16: Location
Figure 4.17: CSS box model
Figure 4.18: Block-level elements
Figure 4.19: Inline elements
Figure 4.20: Block and inline elements together
Set 1: Image contains 1 line of code. Set 2: Image contains 4 lines of code.
Figure 4.21: Background image properties
Set 1: Image contains 4 lines of code. Set 2: Image contains 7 lines of code.
Figure 4.22: Border and shadow properties
Figure 4.23: Borders, margins, and padding provide element spacing and differentiation
Set 1: Image contains 1 line of code. Set 2: Image contains 4 lines of code
Figure 4.24: Collapsing vertical margins
Figure 4.25: CSS TRBL (Trouble) shortcut
Figure 4.26: Calculating an element’s true size
Figure 4.27: Limitations of height property
Figure 4.28: Overflow property
Image contains 6 lines of code
Figure 4.29: Box sizing via percents
Figure 4.30: Completed Test Your Knowledge #2
Figure 4.31: Specifying the font family
Figure 4.32: The different font families
Figure 4.33: Using percents and em units for font sizes
Figure 4.34: Complications in calculating percents and em units
Figure 4.35: Using rem units
Figure 4.36: Using Google Fonts
Figure 4.37: Sample text properties
Set 1: Image contains 3 lines of code. Set 2: Image contains 6 lines of code.
Set 1: Image contains 4 lines of code. Set 2: Image contains 5 lines of code.
Figure 4.38: Completed Test Your Knowledge #3 competent
Figure 4.39: Examples using only Materialize and Bootstrap classes
Figure 4.40: Using a grid in print design
Figure 4.41: Completed Project 1
Figure 4.42: Completed Project 2
Figure 4.43: Completed Project 3
Figure 5.1: Examples of tables
Figure 5.2: Basic table structure
Figure 5.3: Adding table headings
Figure 5.4: Spanning columns
Figure 5.5: Spanning rows
Figure 5.6: Additional table elements
Figure 5.7: Styling table borders
Figure 5.8: An example boxed table
Figure 5.9: Hover effect and zebra stripes
Image contains 6 lines of code and its output.
Figure 5.10 Completed Test Your Knowledge #1 Figure 5.10 Full Alternative TextBackThe browser window has a tab titled Lab 5. The address bar reads, 127 dot 0 dot 0 dot 1 colon 5500 forward slash lab 05 hyphen test 01 dot h t m l. The table consists of 10 columns and 4 rows. The headings of the columns are as follows: hash, TEAMS, P, W, D, L, F, “A”, G D, and P t s. The headings tab is highlighted grey. The row entries are as follows. First row: Hash column, 1. TEAMS column, Liverpool. P column, 8. W column, 6. D column, 2. L column, 0. F column, 22. “A” column, 8. G D column, 14. P t s column, 20. Next row: Hash column, 2. TEAMS column, Manchester City. P column, 8. W column, 5. D column, 1. L column, 2. F column, 20. “A” column, 10. G D column, 10. P t s column, 16. Next row: Hash column, 3. TEAMS column, West Ham United. P column, 8. W column, 4. D column, 3. L column, 1. F column, 7. “A” column, 4. G D column, 3. P t s column, 15. Last row: Hash column, 4. TEAMS column, Arsenal. P column, 8. W column, 4. D column, 2. L column, 2. F column, 15. “A” column, 10. G D column, 5. P t s column, 14. The values in all the columns are aligned to the center of the columns, except for the TEAMS column, where the values are aligned to the left. The columns are equally spaced on either sides. An arrow labeled padding hyphen left colon 24 p x points to the left of the Hash column. The C S S code that corresponds to the headings tab is as follows: Line 1: background hyphen color colon hash E D E D E D semicolon Line 2: Padding colon 12 p x 0 semicolon height colon 40 p x. The C S S code that corresponds to the bottom of the table is as follows: Line 1: border hyphen bottom colon solid 2 p x hash E D E D E D semicolon. Line 2: border hyphen collapse colon collapse semicolon.Back
Figure 5.11: Sample HTML form
Figure 5.12: How forms work
Figure 5.13: Query string data and its connection to the form elements
Figure 5.14: URL encoding
Figure 5.15: GET versus POST
Figure 5.16: Text input controls
Figure 5.17: Using the pattern attribute
Figure 5.18: Using the <datalist> element
Figure 5.19: Using the <select> element
Figure 5.20: The value attribute
Figure 5.21: Radio buttons
Figure 5.22: Checkbox buttons
Figure 5.23: Example button elements
Figure 5.24: File upload control (in Chrome)
Figure 5.25: Number and range input controls
Figure 5.26: Displaying numbers using the <meter> and <progress> elements
Figure 5.27: Color input control
Figure 5.28: Date and time controls
Figure 5.29: Completed Test Your Knowledge #2
Figure 5.30: Associating labels and input elements
Figure 5.31: Styling text and buttons controls
Figure 5.32: Working with labels
Figure 5.33: Form design guidelines
Figure 5.34: Displaying error messages
Figure 5.35: Indicating where an error is located
Figure 5.36: Providing textual hints
Figure 5.37: Using tool tips
Figure 5.38: Using input masks
Figure 5.39: HTML5 browser validation
Figure 5.40: Visualizing levels of validation
Figure 5.41: Version control software
Figure 5.42: Git workflow
Figure 5.43: Completed Project 1
Figure 5.44: Completed Project 2
Figure 5.45: Completed Project 3
Figure 6.1: Pixels versus halftones
Figure 6.2: Raster images
Figure 6.3: Raster editors
Figure 6.4: Vector images
Figure 6.5: Resizing raster images versus vector images
Figure 6.6: (A) RGB color model (B) CMYK color model
Figure 6.7: Picking RGB colors
Figure 6.8: Color gamut
Figure 6.9: HSL color model
Figure 6.10: Opacity settings
Figure 6.11: Specifying the opacities shown in Figure 6.10 using CSS
Figure 6.12: Example CSS gradients
Figure 6.13: Visualizing image color depth
Figure 6.14: Dithering
Figure 6.15: Interpolating
Figure 6.16: Enlarging versus reduction
Figure 6.17: Resizing artwork in the browser versus resizing originals
Figure 6.18: Interpolation algorithms
Figure 6.19: Effect of display resolution versus monitor size
Figure 6.20: Pixels in high-density displays
Figure 6.21: JPEG file format
Figure 6.22: JPEG artifacts
Figure 6.23: JPEG and art work
Figure 6.24: GIF file format
Figure 6.25: Run-length compression
Figure 6.26: Color palette
Figure 6.27: Optimizing GIF images
Figure 6.28: GIF transparency
Figure 6.29: GIF transparency and anti-aliasing
Figure 6.30: PNG transparency
Figure 6.31: SVG example
Figure 6.32: Cloud-Based Image Service (Cloudinary)
Figure 6.33: Media encoding and containers
Figure 6.34: Using the <video> element
Figure 6.35: Using the <audio> element
Figure 6.36: Practical color in web interfaces
Figure 6.37: Example starting color palette
Figure 6.38: Using HSL
Figure 6.39: Completed Project 1
Figure 6.40: Completed Project 2
Figure 6.41: Completed Project 3
Figure 7.1: Layout columns
Figure 7.2: Floating an element
Figure 7.3: Relative positioning
Figure 7.4: Absolute positioning
Figure 7.5: Absolute position is relative to nearest positioned ancestor container
Figure 7.6: Using relative and absolute positioning
Figure 7.7: Using the display property
Figure 7.8: Comparing display to visibility
Figure 7.9: Using hover with display
Figure 7.10: Comparing flex and grid layout
Figure 7.11: Using flexbox to simplify layout
Figure 7.12: Flex containers and items
Figure 7.13: The flexbox container (parent) properties
Figure 7.14: The flexbox item (child) properties
Set 1: Image contains 3 lines of code. Set 2: Image contains 4 lines of code. Set 3: Image contains 3 lines of code. Set 4: Image contains 3 lines of code.
Set 1: Image contains 8 lines of code. Set 2: Image contains 4 lines of code. Set 3: Image contains 3 lines of code. Set 4: Image contains 3 lines of code.
Figure 7.15: Implementing a card layout using flexbox
Figure 7.16 Completed Test Your Knowledge #1 Figure 7.16 Full Alternative TextBackThe browser window has a tab titled Chapter 7. The address bar reads, 127 dot 0 dot 0 dot 1 colon 5501 forward slash lab 07 hyphen test 01 dot h t m l. The browser has an image spread across the background of the browser window and shows a text at the top left corner that reads, Site Title. The top right corner shows three small lines placed one below representing a button. The textbox labeled Find Your Dream is placed at the center of the background image. A button labeled GO is placed at the right end of the textbox.Back
Figure 7.17: Introducing grid display
Figure 7.18: Specifying column widths
Figure 7.19: Using explicit grid item placement
Figure 7.20: Aligning content within grid cell
Figure 7.21: Aligning content within grid container
Figure 7.22: Nested grids
Figure 7.23: Using grid areas
Figure 7.24: Using grid and flex together
Figure 7.25: Completed Test Your Knowledge #2
Figure 7.26: Responsive layouts
Figure 7.27: Flexible layout adapting to browser widths
Figure 7.28: Mobile scaling (without viewport)
Figure 7.29: Setting the viewport
Figure 7.30: Sample media query
Figure 7.31: Media queries in action
Figure 7.32: Responsive design patterns
Figure 7.33: The <picture> element and responsive design
Figure 7.34 Completed Test Your Knowledge #3 Figure 7.34 Full Alternative TextBackBrowser Window 1 appears on the top right of the figure. It has a user form data that has 2 blocks placed side-by-side, each occupying fifty percent of window.Block 1 has a dialog box appearing in the middle of the page placed over a background image. The dialog box has a level-1 heading that reads, Plan Type. Three textboxes are placed one below the other below the heading. Each of the textboxes has a text aligned to the left and a radio button aligned to the right. The text reads from top to bottom as follows: Free, Student, Professional.Block 2 has a level-1 heading that reads, Sign Up and is followed by a line of text. Three textboxes are placed one below the other below the heading. The textboxes are labeled as follows: Email, Password, Request Password. A button labeled Sign Up is placed below the third textbox. There is an additional text and 3 icons placed side-by-side at the bottom of the block.Note: Starting form looks good at desktop widths, but requires customization in media query for it to work at mobile widths.Browser Windows 2 appears at the bottom left of the Browser Window 1. It has a user form data that has 2 blocks placed one below other.Block 1 shows the dialog box that appears in block 1 of browser window 1 without the background image.Block 2 shows the 50 percent of the contents of block 2 in browser window 1. A vertical scrollbar at the right side of the browser window helps to see the rest of the content of the block.The contents of the blocks in browser window 2 appears larger than the contents in browser window 1. Note: Your media query needs to change the grid layout, remove the background image, change the base font size, and fine-tune some margins and padding.Back
Figure 7.35: CSS transforms
Figure 7.36: CSS3 perspective
Figure 7.37: CSS filters in action
Figure 7.38: A simple background-color transition on a button
Figure 7.39: A sliding menu transition
Figure 7.40: Transitioning several properties
Figure 7.41: Transitions versus animations
Figure 7.42: Animation example
Figure 7.43: How Sass works
Figure 7.44: Using mixins
Figure 7.45: Blocks, elements, and modifiers
Figure 7.46: Sample style guides
Figure 7.47: Completed Project 1
Figure 7.48: Completed Project 2
Figure 7.49: Completed Project 3
Figure 8.1: Downloading and executing a client-side JavaScript script
Figure 8.2: Contemporary JavaScript coding
Figure 8.3: Contemporary JavaScript coding
Figure 8.4: Adding JavaScript to a page
Figure 8.5: Variable declaration and assignment
Figure 8.6: JavaScript output options
Figure 8.7: Chrome JavaScript console
Figure 8.8: Primitive types versus reference types
Figure 8.9: let versus const
Figure 8.10: The conditional (ternary) operator
Figure 8.11: For loop
Figure 8.12: JavaScript array with indexes and values illustrated
Figure 8.13 Output from finished Test Your Knowledge #3 Figure 8.13 Full Alternative TextBackThe browser window titled Lab 8. The address text box reads: lab08 forward slash lab08 forward slash test03 dot h t m l.The browser contains two level-1 heading, and one paragraph. The browser starts with a level 1 heading that reads “Test Your Knowledge hash 3".Next is a level 1 heading that reads Output will be in the console.Next is a paragraph that reads “For bill of dollar 50 the tip should be $10. lab08 hyphen test03 dot j s colon 39 colon 5.For bill of dollar 150 the tip should be dollar 15. lab08 hyphen test03 dot j s colon 39 colon 5.For bill of dollar 20 the tip should be dollar 6. lab08 hyphen test03 dot j s colon 39 colon 5.For bill of dollar 500 the tip should be $50. lab08 hyphen test03 dot j s colon 39 colon 5.Back
Figure 8.14: Objects containing other content
Figure 8.15: JSON in contemporary web development
Figure 8.16: Function hoisting in JavaScript
Figure 8.17: Using a callback function
Figure 8.18: Passing a function definition to another function
Figure 8.19: Contextual meaning of the this keyword
Figure 8.20: What happens with a constructor call of a function
Figure 8.21: Array syntax overview
Figure 8.22: The "this" keyword in arrow and non-arrow functions
Figure 8.23: Global versus block scope
Figure 8.24: Function versus global scope
Figure 8.25: Visualizing scope
Figure 8.26: Visualizing the problem
Figure 8.27: Visualizing scope again
Figure 8.28: Scope illustrated in the debugger
Figure 8.29: Closures maintain lexical (design-time) scope
Figure 8.30: Completed Project 1
Figure 8.31: Completed Project 2
Figure 8.32: Completed Project 3
Figure 9.1: DOM tree
Figure 9.2: DOM nodes
Figure 9.3: Using the getElement selection methods
Figure 9.4: Using querySelector and querySelectorAll selection methods
Figure 9.5: Finished Test Your Knowledge #1
Figure 9.6: Manipulating the CSS classes of an element
Figure 9.7: DOM family relations
Figure 9.8: Visualizing the DOM modification
Figure 9.9: Finished Test Your Knowledge #2
Figure 9.10: JavaScript event handling
Figure 9.11: Event handling with NodeList arrays
Figure 9.12: Using the Event object
Figure 9.13: Event capture and bubbling
Figure 9.14: Problems with event propagation
Figure 9.15: Event delegation
Figure 9.16: Finished Test Your Knowledge #3
Figure 9.17: Lazy loading via frame events
The figure consists of 4 browser windows that illustrate the transition of a webpage when a user interacts with the browser.
The figure consists of a C S S code and an H T M L code.
The figure consists of a JavaScript code.
Figure 9.18: Responding to the focus and blur events
Figure 9.19: Responding to the change events
Figure 9.20: Properties of a select list
Figure 9.21: Finished Test Your Knowledge #4
Figure 9.22: Debugging within the FireFox browser
Figure 9.23: Evaluating JavaScript performance in the Chrome browser
Figure 9.24: JavaScript linters
Figure 9.25 : Finished project 1
Figure 9.26 : Finished project 2
Figure 9.27 : Finished project 3
Figure 10.1: How forEach() works
Figure 10.2: Using the map() function
Figure 10.3: The memory impact of functions in objects
Figure 10.4: Using the prototype property
Figure 10.5: Name conflicts in JavaScript
Figure 10.6: Modules in JavaScript
Figure 10.7: Finished Test Your Knowledge #2
Figure 10.8: Web API versus web page
Figure 10.9: Normal HTTP request–response loop
Figure 10.10: Asynchronous data requests
Figure 10.11: Illustration of a list being updated asynchronously
Figure 10.12: Illustration of fetch behavior in the browser console
Figure 10.13: Example of asynchronous request using fetch
Figure 10.14: Common fetch mistake
Figure 10.15: Process flow for fetching via POST example
Figure 10.16: Adding a loading animation
Figure 10.17: Test Your Knowledge #3
Figure 10.18: Promises in real life and in JavaScript
Figure 10.19: Example problem solved using promises
Figure 10.20: Executing multiple Promises in parallel
Figure 10.21: Potential performance benefits of parallel invocations of fetch
Figure 10.22 : Common problems when using async . . . await
Figure 10.23 : Completed Test Your Knowledge # 4
Figure 10.24: Google Maps at work
Figure 10.25: Finished extended example
Figure 10.26: Transforming data for the chart
Figure 10.27: Completed Project 1
Figure 10.28: Completed Project 2
Figure 10.29: Completed Project 3
Figure 11.1: Virtual versus real DOM manipulations
Figure 11.2: SPA using a framework
Figure 11.3: Simple React example
Figure 11.4: JSX to JavaScript conversion
Figure 11.5: Composing an interface with React components
Figure 11.6: Using props
Figure 11.7: React state within a class component
Figure 11.8: Conditional rendering of Listing 11.5
Figure 11.10: Sharing data between components
Figure 11.11: Data communication between components
Figure 11.12: Implementing data flow between components
Image contains 11 lines of code
Figure 11.13: React via runtime conversion versus design-time conversion
Figure 11.14: Problem of dependencies between JavaScript files
Figure 11.15: Create React App
Figure 11.16: React routing in action
Figure 12.1: Front-end versus back-end
Figure 12.2: Hosting a web server locally
Figure 12.3: Running PHP server from the command line
Figure 12.4: Using XAMPP
Figure 12.5: Online PHP development environments
Figure 12.6: More complicated concatenation examples explained
Figure 12.7: Illustration of components in a printf statement and output
Figure 12.8: Completed Test Your Knowledge #1
Figure 12.9: The include files
The figure consists of a block of code and its result in a browser.
Figure 12.10: Pass by value versus pass by reference
Figure 12.11: Completed Test Your Knowledge #2
Figure 12.12: Visualization of a key-value array
Figure 12.13: Explicitly assigning keys to array elements
Figure 12.14: Array with strings as keys and integers as values
Figure 12.15: Visualizing multidimensional arrays
Set 1: Image contains 5 lines of code. Set 2: Image contains 7 lines of code. Set 3: Image contains 5 lines of code
Image contains 12 lines of code
Figure 12.16: Completed Test Your Knowledge #3
Figure 12.17: Relationship between a class and its objects
Figure 12.18: Sample ways to diagram a class using UML
Figure 12.19: Visibility of class members
Figure 12.20: A static property
Figure 12.21: UML class diagrams showing inheritance
Figure 12.22: Illustration of flow from HTML, to request, to PHP’s $_GET array
Figure 12.23: Data flow from HTML form through HTTP request to PHP’s $_POST array
Figure 12.24: URL encoding and decoding
Figure 12.25: Form display and processing by the same PHP page
Figure 12.26: Inefficient approach to displaying individual items
Figure 12.27: Sensible approach to displaying individual items using query strings
The image consists of 2 browser windows and a P H P code.
The figure consists of a P H P code and an H T M L code.
Figure 12.28: PHP Redirect using the Location header
Figure 12.29: PHP creating a custom image
Figure 12.30: Completed Project 1
Figure 12.31: Completed Project 2
Figure 12.32: Completed Project 3
Figure 13.1: Example of a push web application
Figure 13.2 : Blocking thread-based architecture
Figure 13.3: Nonblocking thread-based architecture
Figure 13.4: Handling high volume data changes in Node
Figure 13.5: Running the Hello World example
Figure 13.6: Static file server
Figure 13.7: Middleware functions in Express
Figure 13.8: Sending data to an API
Figure 13.9: API testing tools
Figure 13.10: Message flow using Socket.io
Figure 13.11: Chat in the browser
Figure 13.12: View Engines and Node
Figure 13.13: Serverless computing analogy
Figure 13.14: Functions-as-a-Service
Figure 13.15: Completed Project #3
Figure 14.1: Separating content from data
Figure 14.2: How websites use databases
Figure 14.3: Multiple ways to access MySQL are available
Figure 14.4: MySQL command-line interface
Figure 14.5: phpMyAdmin
Figure 14.7: MySQL Workbench
Figure 14.8: SQLite Tools
Figure 14.9: A database table
Figure 14.10: Diagramming a table
Figure 14.11: Foreign keys link tables
Figure 14.12: Diagramming a one-to-many relationship
Figure 14.13: Implementing a many-to-many relationship
Figure 14.14: SQL SELECT from a single table
Figure 14.15: Using the WHERE clause
Figure 14.16: SQL SELECT from multiple tables using an INNER JOIN
Figure 14.17: Using GROUP BY with aggregate functions
Figure 14.18: SQL INSERT, UPDATE, and DELETE
Figure 14.19: Distributed transaction processing
Figure 14.20: Visualization of a database index for our Books table
Figure 14.21: Basic database connection algorithm
Figure 14.22: Fetching from a result set
Figure 14.23: Integrating user input data into a query
The figure shows some code lines.
Figure 14.24 Test Your Knowledge #1Figure 14.24 Full Alternative TextBackA browser window is shown here. The browser window has a tab titled Lab 14. The address bar reads, localhost forward slash lab 14 forward slash lab 14 hyphen test 01 dot p h p question mark museum equals 30. The browser window consists of two level-1 headings, one level-2 heading, a level-3 heading and four paragraphs. The browser window consists of two divisions that are placed side-by-side. Division 1 shows a level-2 heading that reads, "Filters.” The level-3 heading that reads, Museum” is placed below the level-2 heading. A textbox with a dropdown list that contains the value Rijksmuseum is placed below the level-3 heading. A button labeled Filter is placed below the textbox. Division 2 shows a level-1 heading that reads, "Paintings.” Four images of the paintings available in the museum labeled Rijksmuseum are placed one below the other along with their descriptions and the price amount in division 2 below the Paintings heading.Back
Figure 14.25: Data in a key/value store
Figure 14.26: Relational data versus document store data
Figure 14.27: Contrast between row- and column-wise stores
Figure 14.28: Relationships in a graph database
Figure 14.29: Comparing relational databases to the MongoDB data model
Figure 14.30: Running the MongoDB Shell
Figure 14.31: Comparing a MongoDB query to an SQL query
Figure 14.32: Problem of consistency in multiple data server environments
Figure 14.33: Single master replication
Figure 14.34: Failover clustering on master
Figure 14.35: Multiple master replication
Figure 14.36: Database sharding
Figure 14.37: Completed Project 1
Figure 14.38: Completed Project 3
Figure 15.1: Illustrating the problem of state in web applications
Figure 15.2: Desktop applications versus web applications
Figure 15.3: What the web server sees
Figure 15.4: Two approaches for passing data in a URL
Figure 15.5: Recap of GET versus POST
Figure 15.6: Uploading files
Figure 15.7: Cookies at work
Figure 15.8: Session state
Figure 15.9: Session IDs
Figure 15.10: Requests spread across multiple servers
Figure 15.11: Shared session provider
Image contains 17 lines of code
Figure 15.12: Page output caching
Figure 15.13: Use case for caching
Figure 15.14: Caching in action
Figure 15.15: Redis use cases
Figure 15.16: Inconsistent cached data within a two-core CPU
Figure 15.17: Write-through vs. write-back caching in web context
Figure 15.18: Completed Project 1
Figure 15.19: Completed Project 2
Figure 16.1: The CIA triad: confidentiality, integrity, and availability
Figure 16.2: Some examples of security input into the SDLC
Figure 16.3: Basic HTTP Authentication
Figure 16.4: The form authentication process
Figure 16.5: Managing login status
Figure 16.6: Stateless authentication using tokens
Figure 16.7: JWT structure
Figure 16.8: The steps required to register and authenticate a user using OAuth
Figure 16.9: Alice transmitting to Bob with Eve intercepting the message
Figure 16.10: Alice and Bob using symmetric encryption to transmit messages
Figure 16.11: Caesar cipher for shift value of 3. HELLO becomes KHOOR
Figure 16.12: Letter frequency in the English alphabet using Oxford English Dictionary summary9
Figure 16.13: High-level illustration of the DES cipher
Figure 16.14: Illustration of a simple Diffie-Hellman Key Exchange for g=2 and p=11
Figure 16.15: Illustration of a digital signature flow
Figure 16.16: Screenshot from Google’s Gmail service, using HTTPS
Figure 16.17: SSL/TLS handshake
Figure 16.18: The contents of a self-signed certificate for funwebdev.com
Figure 16.19: The Firefox Certificate Authority Management interface
Figure 16.20: Certificates in the browser
Figure 16.21: Firefox warning that arises from a self-signed certificate
Figure 16.22: HTTPS downgrade attack.
Figure 16.23: Hashing and digests
Figure 16.24: Rainbow tables
Figure 16.25: Salting a password
Figure 16.26: Remembering a user logon
Figure 16.27: Screenshot of the Nagios web interface (green means OK)
Figure 16.28: Illustration of a SQL injection attack (right) and intended usage (left)
Figure 16.29: Illustration of a Reflection XSS attack
Figure 16.30: Illustration of a stored XSS attack in action
Figure 16.31: Cross-site request forgery attack
Figure 16.32: Illustration of a Denial of Service (DoS) and a Distributed Denial of Service (DDoS) attack
Figure 16.33: Illustrated virtual open relay exploit
Figure 16.34: Illustrated exploit of a command-line pass-through of user input
Figure 17.1: Continuous integration and deployment
Figure 17.2: Workflow and architecture of the Selenium testing system
Figure 17.3: Monolithic architecture
Figure 17.4: Microservice architecture
Figure 17.5: Illustration of the registrant information available to anyone in the WHOIS system
Figure 17.6: Illustration of a private registration through a third party
Figure 17.7: Annotated usage of the dig command
Figure 17.8: Illustration of a zone file with A, AAAA, CName, MX, SOA, and SPF DNS records
Figure 17.9: Annotated SPF string for funwebdev.com
Figure 17.10: Simple shared hosting, with users having their own home folder
Figure 17.11: Virtualized shared host, where each user has a virtual server of their own
Figure 17.12: Multiple servers versus a virtualized server
Figure 17.13: Type 1 and Type 2 hypervisors compared
Figure 17.14: Vagrant
Figure 17.15: Working with Vagrant
Figure 17.16: Container-based virtualization
Figure 17.17: Web server popularity
Figure 17.18: Illustration of a reused connection in Apache
Figure 17.19: Permission bits and the corresponding octal number
Figure 17.20: How three sites are hosted on one IP address with VirtualHosts
Figure 17.21: The ways of responding to a folder request
Figure 17.22: Apache server using a redirect on a request
Figure 17.23: Illustration of the RewriteRule syntax
Figure 17.24: Internal URL rewriting rules as seen by the client
Figure 17.25: Illustration of the RewriteCond directive matching an IP address
Figure 17.26: Prompt for authentication from an .htaccess file
Figure 18.1: Major components of a search engine
Figure 18.2: Visualization of indexes on database tables
Figure 18.3: Reverse index illustration
Figure 18.4: Webpages A, B, C, and D and their links
Figure 18.5: Illustration of two iterations of PageRank
Figure 18.6: Iterations of PageRank with a rank sink (A)
Figure 18.7: Sample search engine output
Figure 18.8: A five-site link farm with rank equally distributed
Figure 18.9: PageRank distribution in a link pyramid after two iterations
Figure 18.10: Illustration of canonical URLs and relationships
Figure 18.11: Illustration of email social networks
Figure 18.12: Social network connection via multiple media, categories, and public broadcasts
Figure 18.13: Screenshot of Facebook pages for this textbook
Figure 18.14: Illustration of a URL shortening service
Figure 18.15: Relationship between a plugin on your page and the resulting Facebook newsfeed items
Figure 18.16: Screenshot of the Facebook Like social plugin
Figure 18.17: Screenshot of story on a Facebook newsfeed, generated in response to clicking Like
Figure 18.18: Illustration of Open Graph’s actors, apps, actions, and objects
Figure 18.19: Output of the Facebook Open Graph Debugger and best guesses it will make
Figure 18.20: Annotated relationship between some Open Graph tags and the story that appears in the Facebook newsfeed in response to liking a page
Figure 18.21: The Tweet button
Figure 18.22: Twitter Follow button
Figure 18.23: Screenshot of the Twitter Widget code generator
Figure 18.24: Illustration of an integrated Facebook web game
Figure 18.25: The challenge of managing a WWW site without hosting considerations and the benefit of a web content management system
Figure 18.26: Screenshot of the post editor in WordPress
Figure 18.27: Screenshot of the TinyMCE WYSIWYG editor included with WordPress
Figure 18.28: The HTML view of a WYSIWYG editor
Figure 18.29: TinyMCE with a style dropdown box using the styles from a predefined CSS stylesheet
Figure 18.30: Multiple templates and their relationship to content
Figure 18.31: Typical roles and responsibilities in a web CMS
Figure 18.32: Multiple dashboard menus for the five default roles in WordPress
Figure 18.33: Illustration of multiple people working in a workflow
Figure 18.34: Media management portal in WordPress
Figure 18.35: Screenshot of the WordPress directory structure
Figure 18.36: Difference in installation between a single and multisite
Figure 18.37: Illustration of WordPress components used to generate HTML output
Figure 18.38: A simplified illustration of the default template selection hierarchy in WordPress
Figure 18.39: Relationship between the parties in web advertising
Figure 18.40: Real-time auctions and ad placements in an advertising network
Figure 18.41: Screenshot from Bing’s webmaster tools showing a range of stats
Figure 18.42: Screenshot of the top of the AWStats analytics report
Figure 18.43: A dashboard from the Google Analytics tool
Figure 18.44: Showing where users flow through and leave a website.
Figure 18.45: The Lighthouse tool showing an initial analysis for funwebdev.com
Figure 18.46: Thumbnails sequences generated by Lighthouse while analyzing the loading time of funwebdev.com
Figure 18.47: The Lighthouse tool showing the final analysis for funwebdev.com
Figure 18.48: Hadoop big data processing
Figure 18.49: Portion of the Art Store with Facebook Like, and Tweet This widgets
Figure 18.50: Illustration of eventual end goal of Project 18.1
List of Tables
Table 14.2 Approximate MongoDB equivalences to RDMS
Landmarks
Brief Table of Contents
Front Matter
Start of Content
Back Matter
List of Figures
List of Tables
Page List
i
ii
iii
iv
v
vi
vii
viii
ix
x
xi
xii
xiii
xiv
xv
xvi
xvii
xviii
xix
xx
xxi
xxii
xxiii
xxiv
xxv
xxvi
xxvii
xxviii
xxix
xxx
xxxi
xxxii
xxxiii
xxxiv
xxxv
xxxvi
xxxvii
xxxviii
xxxix
xl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040