Dynamic Web Programming and HTML5

Book description

With organizations and individuals increasingly dependent on the Web, the need for competent, well-trained Web developers and maintainers is growing. Helping readers master Web development, Dynamic Web Programming and HTML5 covers specific Web programming languages, APIs, and coding techniques and provides an in-depth understanding of the underlyin

Table of contents

  1. Cover
  2. Half Title
  3. Title Page
  4. Copyright Page
  5. Table of Contents
  6. Preface
  7. Introduction
  8. 1 The Web: An Overview
    1. 1.1 Web Is Part of the Internet
    2. 1.2 IP Addresses and Domain Names
      1. 1.2.1 Domain Name System
    3. 1.3 Web Clients and Servers
    4. 1.4 URLs
      1. 1.4.1 URL Encoding
    5. 1.5 Handling Different Content Types
    6. 1.6 HTML and HTML5
    7. 1.7 Webpage Styling
      1. 1.7.1 Text Editing
    8. 1.8 Web Hosting
    9. 1.9 Web Servers
    10. 1.10 Domain Registration
      1. 1.10.1 Accessing Domain Registration Data
    11. 1.11 DNS
      1. 1.11.1 DNS Servers
      2. 1.11.2 DNS Resolvers
    12. 1.12 Dynamic Generation of Webpages
      1. 1.12.1 Active Server Pages
    13. 1.13 Database Access
    14. 1.14 Client-Side Scripting
    15. 1.15 Document Object Model
    16. 1.16 Hypertext Transfer Protocol
    17. 1.17 Web Development
      1. 1.17.1 Web Development Principles
      2. 1.17.2 Web Development Process
    18. 1.18 For More Information
    19. 1.19 Summary
    20. Exercises
  9. 2 Webpage Markup with HTML5
    1. 2.1 HTML5 Page Structure
    2. 2.2 Creating a Webpage
    3. 2.3 HTML5 Elements and Entities
    4. 2.4 Evolution of HTML
    5. 2.5 HTML5 Features and Advantages
    6. 2.6 Webpage Syntax
    7. 2.7 HTML5 Core Attributes
    8. 2.8 Webpage Architecture
    9. 2.9 Headings and Paragraphs
      1. 2.9.1 Quotations
    10. 2.10 White Space and Line Wrapping
      1. 2.10.1 Preformatted Text
    11. 2.11 Phrasing Elements
      1. 2.11.1 Formatted Time
    12. 2.12 Webpage Presentation Styles
      1. 2.12.1 Foreground and Background Colors
      2. 2.12.2 Text Alignment
      3. 2.12.3 Style Length Units
      4. 2.12.4 Colors
      5. 2.12.5 Text Fonts
    13. 2.13 Itemized Lists
    14. 2.14 List Styles
    15. 2.15 Links in Webpages
      1. 2.15.1 Internal and External Links
      2. 2.15.2 Site Organization and Navigation
      3. 2.15.3 Linking to Services
      4. 2.15.4 Display Style for Links
    16. 2.16 Navbars
    17. 2.17 Pictures and Images in Webpages
      1. 2.17.1 Clickable Image Links
      2. 2.17.2 Text around Images
      3. 2.17.3 Image Alignment inside a Line
    18. 2.18 Figures
    19. 2.19 Image Encoding Formats
      1. 2.19.1 GIF, JPEG, and PNG
      2. 2.19.2 Aliasing and Anti-Aliasing
      3. 2.19.3 Colors in Raster Images
      4. 2.19.4 Dithering
    20. 2.20 Image Maps
    21. 2.21 Webpage Layout
    22. 2.22 Debugging and Validation
    23. 2.23 Summary
    24. Exercises
  10. 3 Audio, Video, and More HTML5
    1. 3.1 Audio for the Web
      1. 3.1.1 Digital Audio
      2. 3.1.2 Audio Encoding Formats
      3. 3.1.3 The audio Element
    2. 3.2 Playing Video
      1. 3.2.1 Video Containers
      2. 3.2.2 Video Codecs
      3. 3.2.3 The video Element
    3. 3.3 Embedding Media
      1. 3.3.1 Embedding Flash
      2. 3.3.2 Embedding PDF
      3. 3.3.3 Embedding Java Applet
    4. 3.4 Tables
      1. 3.4.1 Table Basics
      2. 3.4.2 Content Alignment in a Table Cell
      3. 3.4.3 Displaying Tables
      4. 3.4.4 Positioning Tables
      5. 3.4.5 Table Layout
      6. 3.4.6 Row and Column Spans
      7. 3.4.7 Rules between Cells
      8. 3.4.8 Grouping Rows and Columns
    5. 3.5 Using Tables for Page Layout
    6. 3.6 Pagewide Style with body
    7. 3.7 HTML5 Entities
    8. 3.8 Webpage Character Encoding
    9. 3.9 Numeric and Named Character References
    10. 3.10 Metadata and Head Elements
      1. 3.10.1 Search Engine Ready Pages
      2. 3.10.2 Prefetching Pages and Resources
      3. 3.10.3 Forwarding Pages
      4. 3.10.4 Portable Pages
      5. 3.10.5 Website Icons
    11. 3.11 Subordinate Webpages with iframe
      1. 3.11.1 Link Targets
      2. 3.11.2 Controlling Iframes
    12. 3.12 Website File Organization
    13. 3.13 Internationalization
    14. 3.14 Summary
    15. Exercises
  11. 4 Styling with CSS
    1. 4.1 CSS Basics
      1. 4.1.1 Style Sheets
      2. 4.1.2 Attaching a Style Sheet
      3. 4.1.3 A Brief History of CSS
    2. 4.2 Whole-Page Styling
    3. 4.3 Centering and Indenting
    4. 4.4 Centered Page Layout
    5. 4.5 Multicolumn Layout
    6. 4.6 CSS Selectors
    7. 4.7 Link Styles
    8. 4.8 Conflicting Rules
    9. 4.9 Style Properties
    10. 4.10 Webpage Layout with CSS
      1. 4.10.1 Float Layout
      2. 4.10.2 Table Layout
    11. 4.11 A Vertical Navbar
    12. 4.12 Page Formatting Model
    13. 4.13 Margin, Border, and Padding
      1. 4.13.1 Border Styles
      2. 4.13.2 Elastic Banner
      3. 4.13.3 Border Radius
      4. 4.13.4 Replaced Elements
    14. 4.14 Preformatted Content
    15. 4.15 Controlling Content Overflow
    16. 4.16 Styled Buttons
    17. 4.17 Drop Shadows
      1. 4.17.1 Box Shadows
      2. 4.17.2 Text Shadows
    18. 4.18 Borders by Custom Images
    19. 4.19 Background Colors and Images
    20. 4.20 Color Gradient
      1. 4.20.1 Linear Gradients
      2. 4.20.2 Radial Gradients
    21. 4.21 Browser Support for CSS
    22. 4.22 At-Rules
    23. 4.23 Explicit Element Positioning
      1. 4.23.1 Fixed Positioning, Stack Levels, and Visibility
    24. 4.24 CSS-Generated Content
    25. 4.25 Translucent Callout via CSS
    26. 4.26 Understanding the Cascade
      1. 4.26.1 CSS Validation
    27. 4.27 Additional Style Features
    28. 4.28 For More Information
    29. 4.29 Summary
    30. Exercises
  12. 5 Forms, PHP, and Form Processing
    1. 5.1 A Simple Form
    2. 5.2 Basic Input Elements
    3. 5.3 Text Input
    4. 5.4 Input in Standard Formats
    5. 5.5 User Choices and Selections
      1. 5.5.1 Radio Buttons
      2. 5.5.2 Checkboxes
      3. 5.5.3 Pull-Down Menus
    6. 5.6 Form Submission
    7. 5.7 File Uploading
    8. 5.8 Other input Elements
    9. 5.9 Layout and Styling of Forms
    10. 5.9.1 Tabular Form Layout
    11. 5.10 CSS for Form Presentation
    12. 5.11 Forms and HTTP
    13. 5.12 HTTP Message Format
      1. 5.12.1 The Query Line
      2. 5.12.2 The Response Line
      3. 5.12.3 The POST Query
      4. 5.12.4 Formdata Encoding
      5. 5.12.5 Data Posting via GET Queries
      6. 5.12.6 GET versus POST
    14. 5.13 Formdata Security and HTTPS
    15. 5.14 Form Processing Overview
    16. 5.15 PHP Scripting Overview
    17. 5.16 An Introduction to PHP
      1. 5.16.1 PHP Variables
      2. 5.16.2 PHP Conditionals
    18. 5.17 Strings in PHP
    19. 5.18 Arrays in PHP
    20. 5.19 Getting Started with Form Processing
    21. 5.20 Form Processing Example: Club Membership
      1. 5.20.1 Sending Email from PHP
      2. 5.20.2 Loops in PHP
      3. 5.20.3 Multistep Forms
    22. 5.21 HTTP Request Data Exposed
    23. 5.22 Processing File Upload
      1. 5.22.1 Uploading Multiple Files
    24. 5.23 Summary
    25. Exercises
  13. 6 Dynamic User Interface with JavaScript
    1. 6.1 About JavaScript
    2. 6.2 Getting Started with JavaScript
    3. 6.3 Placing JavaScript in Webpages
    4. 6.4 Image Rollovers
    5. 6.5 Image Preloading
    6. 6.6 Presenting a Slide Show
    7. 6.7 JavaScript Arrays
      1. 6.7.1 The foreach Loop
    8. 6.8 A Conversion Calculator
    9. 6.9 Audio/Video Control
    10. 6.10 Pull-Down Menus
    11. 6.11 CSS Transitions
    12. 6.12 Menu Fade-In and Fade-Out
    13. 6.13 Animated Pull-Down Menu
      1. 6.13.1 Triggering CSS Transitions
    14. 6.14 Sliding Menus for a Left Navbar
    15. 6.15 Using Windows
      1. 6.15.1 Dialog Windows
      2. 6.15.2 Opening New Windows
    16. 6.16 JavaScript Language Basics
      1. 6.16.1 JavaScript Operators
      2. 6.16.2 Built-In Functions
      3. 6.16.3 JavaScript Strings
      4. 6.16.4 Defining Functions
      5. 6.16.5 Loops
      6. 6.16.6 Matching Patterns
      7. 6.16.7 Patterns
      8. 6.16.8 Patterns in Input Fields
    17. 6.17 JavaScript Form Checking
    18. 6.18 Smooth Scrolling Text
    19. 6.19 Animation with CSS
    20. 6.20 Transform with CSS
    21. 6.21 Events and Event Objects
      1. 6.21.1 Playlists
      2. 6.21.2 Using Event Objects
      3. 6.21.3 Adding and Removing Event Listeners
    22. 6.22 Testing and Debugging
    23. 6.23 For More Information
    24. 6.24 Summary
    25. Exercises
  14. 7 HTML5 DOM and APIs
    1. 7.1 What Is DOM?
    2. 7.2 Browser Support of DOM
    3. 7.3 HTML5 DOM API Overview
      1. 7.3.1 DOM Tree Nodes
    4. 7.4 Putting DOM to Work
    5. 7.5 Node API
      1. 7.5.1 Node Fields
      2. 7.5.2 Node Methods
    6. 7.6 DOM Tree Depth-First Traversal
    7. 7.7 DOM HTMLElement Interface
    8. 7.8 HTMLElement Fields and Methods
    9. 7.9 Document and HTMLDocument Interfaces
      1. 7.9.1 Fields of document
      2. 7.9.2 Methods of document
    10. 7.10 Generating New Content
      1. 7.10.1 A Session-Recording Calculator
    11. 7.11 A Smart Form
    12. 7.12 Client-Side Data Sorting
      1. 7.12.1 Sortable Data Organization
      2. 7.12.2 Data Sorting JavaScript
      3. 7.12.3 Quicksort
    13. 7.13 A Better User Interface for File/Image Upload
    14. 7.14 TicTacToe with Drag-and-Drop
      1. 7.14.1 DnD Life Cycle
      2. 7.14.2 DnD Data Transfer
      3. 7.14.3 DnD in TicTacToe
      4. 7.14.4 Draggable Source
      5. 7.14.5 Dropzone
    15. 7.15 Tower of Hanoi
    16. 7.16 DnD Local Files
    17. 7.17 Canvas Element and API
      1. 7.17.1 A First canvas Example
      2. 7.17.2 Drawing Shapes
      3. 7.17.3 Color Gradients and Transforms
      4. 7.17.4 Canvas Animation
      5. 7.17.5 Drawing Images and Text
    18. 7.18 For More Information
    19. 7.19 Summary
    20. Exercises
  15. 8 Server-Side Programming with PHP
    1. 8.1 Page Templates
    2. 8.2 PHP Functions
    3. 8.3 Form Generation and Processing
      1. 8.3.1 Form Control Page
      2. 8.3.2 Form Generation
      3. 8.3.3 Form Processing
    4. 8.4 File I/O in PHP
      1. 8.4.1 Listing Files in Directories
    5. 8.5 PHP Error Reporting and Debugging
    6. 8.6 Login with Basic Authentication
      1. 8.6.1 HTTP Basic Authentication
      2. 8.6.2 Basic Authentication via PHP
      3. 8.6.3 Basic Authentication Logout
    7. 8.7 Session Control
      1. 8.7.1 What Is a Session?
      2. 8.7.2 Session Control Techniques
      3. 8.7.3 PHP Session Support
    8. 8.8 Crazy Pizza Shop
    9. 8.9 Security Code Verification
    10. 8.10 Login Sessions
      1. 8.10.1 Login Session with PHP
      2. 8.10.2 A Login-Protected Page
      3. 8.10.3 Logout
      4. 8.10.4 User Registration
      5. 8.10.5 User Profiles
      6. 8.10.6 Session Timeout
    11. 8.11 Image Manipulation
      1. 8.11.1 Security Images
      2. 8.11.2 Watermarking Photographs
    12. 8.12 Providing Content Management
      1. 8.12.1 AMP: Admin Modifiable Page
      2. 8.12.2 Making an AMP
    13. 8.13 HTML5 contenteditable API
      1. 8.13.1 Editable Style
    14. 8.14 Updating the AMP
      1. 8.14.1 Editing Images
      2. 8.14.2 Edit-Control Buttons
      3. 8.14.3 Content Management Summary
    15. 8.15 PHP Classes and Objects
      1. 8.15.1 A Navbar Class
      2. 8.15.2 A PageFront Class
    16. 8.16 System Calls and Script Security
      1. 8.16.1 System Calls in PHP
      2. 8.16.2 PHP Script Security
    17. 8.17 For More Information
    18. 8.18 Summary
    19. Exercises
  16. 9 Database-Driven Websites
    1. 9.1 What Is a Database?
    2. 9.2 Relational Databases
    3. 9.3 SQL: Structured Query Language
    4. 9.4 SQL Queries
      1. 9.4.1 MySQL Expressions
      2. 9.4.2 More on SELECT Queries
      3. 9.4.3 Aggregating Attribute Values
      4. 9.4.4 Selecting from Multiple Tables
    5. 9.5 Creating Tables
    6. 9.6 CREATE TABLE Queries
    7. 9.7 MySQL Data Types
      1. 9.7.1 Data Modifiers
    8. 9.8 PHP Database Access
      1. 9.8.1 Connecting to a Database
      2. 9.8.2 Queries and Resultsets
    9. 9.9 User Authentication Using Database
      1. 9.9.1 Adding a New User
      2. 9.9.2 Authenticating a User
      3. 9.9.3 Changing Passwords
    10. 9.10 INSERT and DELETE Queries
    11. 9.11 Database Supporting Product Orders
      1. 9.11.1 Linking Related Tables
      2. 9.11.2 Displaying Orders in HTML
      3. 9.11.3 Managing Orders
      4. 9.11.4 The FOREIGN KEY Constraint
    12. 9.12 Displaying Shopping Carts
    13. 9.13 Handling Query Results and Errors
      1. 9.13.1 Paginated Display of Larger Result Sets
    14. 9.14 Receiving Payments
      1. 9.14.1 HTTP Requests from PHP
    15. 9.15 Prepared Statements
    16. 9.16 Guarding against SQL Injection
    17. 9.17 The phpMyAdmin Tool
    18. 9.18 PHP Built-In Database System
    19. 9.19 For More Information
    20. 9.20 Summary
    21. Exercises
  17. 10 Web Hosting: Apache, PHP, and MySQL
    1. 10.1 What Is a Web Server?
    2. 10.2 URL and URI
    3. 10.3 Request Processing
    4. 10.4 Response and Content Types
    5. 10.5 Apache Web Server
    6. 10.6 Accessing Linux Server Host
      1. 10.6.1 Understanding the Linux Shell
      2. 10.6.2 Entering Commands
      3. 10.6.3 Current Working Directory and Filenames .
      4. 10.6.4 Handling Files and Directories
    7. 10.7 Linux Files Access Control
      1. 10.7.1 Super User
      2. 10.7.2 Examining the Permission Settings
      3. 10.7.3 Setting Permissions
      4. 10.7.4 File Access Permissions for the Web
    8. 10.8 Running Apache on Linux
      1. 10.8.1 Controlling the Apache Server
    9. 10.9 Apache Run-Time Configuration
      1. 10.9.1 Apache Configuration File Basics
      2. 10.9.2 About Configuration Directives
      3. 10.9.3 Loading Modules
      4. 10.9.4 Global Directives
      5. 10.9.5 Container Directives
    10. 10.10 Apache Web Access Control
      1. 10.10.1 What Is Web Access Control?
      2. 10.10.2 Access Control by Host
    11. 10.11 Requiring Passwords
      1. 10.11.1 Setting Up User Login under Apache
    12. 10.12 How HTTP Basic Authentication Works
    13. 10.13 How HTTP Digest Authentication Works
      1. 10.13.1 Basic versus Digest Authentication
    14. 10.14 Password Encryption
    15. 10.15 Automatic File Deflation
    16. 10.16 URI to Document Space Mapping
    17. 10.17 Virtual Hosting
    18. 10.18 Installing Apache with Package Management
      1. 10.18.1 Sudo
    19. 10.19 Manual Installation of Apache
      1. 10.19.1 Configure and Compile
    20. 10.20 SSL/TLS
    21. 10.21 PHP Module for Apache
      1. 10.21.1 Installing the PHP Module
    22. 10.22 Testing PHP
    23. 10.23 PHP Configuration
      1. 10.23.1 Changing PHP Configurations
    24. 10.24 HTTP Caching
    25. 10.25 MySQL
      1. 10.25.1 Initializing, Starting, and Stopping MySQL
      2. 10.25.2 MySQL Run-Time Configuration
      3. 10.25.3 Administering MySQL
      4. 10.25.4 Resetting the MySQL Root Password
    26. 10.26 Installing phpMyAdmin
    27. 10.27 Installing MySQL
    28. 10.28 Linux Package Management
      1. 10.28.1 YUM and RPM
      2. 10.28.2 APT
    29. 10.29 For More Information
    30. 10.30 Summary
    31. Exercises
  18. 11 XML, AJAX, and Web Services
    1. 11.1 What Is XML?
    2. 11.2 XML Document Format
    3. 11.3 News Syndication Formats
      1. 11.3.1 XML Document Syntax Rules
      2. 11.3.2 Validity of an XML Document
    4. 11.4 Browser Display of XML Documents
    5. 11.5 Transforming XML Documents with XSL
      1. 11.5.1 A First XSL Transform
      2. 11.5.2 XSL Transforms
      3. 11.5.3 XSL Templates
    6. 11.6 Named Templates and Template Calls
      1. 11.6.1 Sorting in XSL
    7. 11.7 XML Processing in PHP
      1. 11.7.1 Making XSL Transforms in PHP
    8. 11.8 XPath
    9. 11.9 AJAX
      1. 11.9.1 Auto Completion with AJAX
    10. 11.10 Soup of the Day
    11. 11.11 AJAX GET and POST Requests
    12. 11.12 Web Services
      1. 11.12.1 Example Web Services
    13. 11.13 Accessing Web Services from PHP
    14. 11.14 Address Verification Web Service
    15. 11.15 AJAX: Form Address Verification
    16. 11.16 AJAX File Upload
    17. 11.17 XML Namespaces
    18. 11.18 For More Information
    19. 11.19 Summary
    20. Exercises
  19. 12 SVG and MathML
    1. 12.1 Including SVG and MathML in HTML5
    2. 12.2 SVG
      1. 12.2.1 Shape Elements
      2. 12.2.2 Including Raster Images
      3. 12.2.3 The path Element
      4. 12.2.4 The text Element
      5. 12.2.5 Curved Arcs
    3. 12.3 SVG Markers, Patterns, and Transforms
      1. 12.3.1 Coordinate Transformation Matrix
    4. 12.4 SVG Animation
      1. 12.4.1 Clipping
    5. 12.5 SVG User Interaction and Scripting
      1. 12.5.1 SVG DOM Manipulations
    6. 12.6 Knocking Balls Simulation
    7. 12.7 SVG versus HTML5 Canvas
    8. 12.8 MathML
      1. 12.8.1 Presentation versus Content MathML
    9. 12.9 Infix to MathML Conversion
    10. 12.10 MathML for Mathematics Education
    11. 12.11 Combining SVG with MathML
    12. 12.12 For More Information
    13. 12.13 Summary
    14. Exercises
  20. 13 HTML5 and Mobile Websites
    1. 13.1 Mobile Web Browsing
    2. 13.2 Mobile Website Strategies
    3. 13.3 Mobile Layout and Navigation
    4. 13.4 CSS Media Queries
    5. 13.5 Mobile Webpages
      1. 13.5.1 A Pane Layout
    6. 13.6 The Viewport
    7. 13.7 Automatic Redirection to Mobile Site
      1. 13.7.1 URL Redirection
      2. 13.7.2 Browser/Device Detection
    8. 13.8 Touch Swipe Slide Show
      1. 13.8.1 Touch Events
      2. 13.8.2 Momentum Scroll
    9. 13.9 Taking Advantage of the Smartphone
      1. 13.9.1 Camera API
      2. 13.9.2 Geolocation API
      3. 13.9.3 The Touch Icon
    10. 13.10 Conversion to Mobile
    11. 13.11 Webapps
      1. 13.11.1 Offline Caching
      2. 13.11.2 Local Storage
    12. 13.12 Mobile Site Testing and Debugging
    13. 13.13 For More Information
    14. 13.14 Summary
    15. Exercises
  21. Appendices Online
    1. Secure Communication with SSH and SFTP
    2. Introduction to vim
    3. Text Editing with vi
    4. Vi Quick Reference
    5. The emacs Editor
    6. A Linux Primer
  22. Website and Online Examples
  23. Bibliography
  24. Index

Product information

  • Title: Dynamic Web Programming and HTML5
  • Author(s): Paul S. Wang
  • Release date: November 2012
  • Publisher(s): Chapman and Hall/CRC
  • ISBN: 9781000755749