Tải bản đầy đủ (.pdf) (729 trang)

IT training learning PHP, MySQL, javascript, CSS HTML5 (3rd ed ) nixon 2014 06 16 1

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (19.98 MB, 729 trang )



THIRD EDITION

Learning PHP, MySQL, JavaScript,
CSS & HTML5

Robin Nixon


Learning PHP, MySQL, JavaScript, CSS & HTML5, Third Edition
by Robin Nixon
Copyright © 2014 Robin Nixon. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (). For more information, contact our corporate/
institutional sales department: 800-998-9938 or

Editor: Andy Oram
Production Editor: Kristen Brown
Copyeditor: Rachel Monaghan
Proofreader: Jasmine Kwityn
June 2014:

Indexer: Lucie Haskins
Cover Designer: Karen Montgomery
Interior Designer: David Futato
Illustrator: Rebecca Demarest

Third Edition



Revision History for the Third Edition:
2014-05-19:

First release

See for release details.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly
Media, Inc. Learning PHP, MySQL, JavaScript, CSS & HTML5, the image of sugar gliders, and related trade
dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark
claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume no
responsibility for errors or omissions, or for damages resulting from the use of the information contained
herein.

ISBN: 978-1-491-94946-7
[LSI]


For Julie



Table of Contents

Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
1. Introduction to Dynamic Web Content. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
HTTP and HTML: Berners-Lee’s Basics

The Request/Response Procedure
The Benefits of PHP, MySQL, JavaScript, CSS, and HTML5
Using PHP
Using MySQL
Using JavaScript
Using CSS
And Then There’s HTML5
The Apache Web Server
About Open Source
Bringing It All Together
Questions

2
2
5
6
7
8
9
10
11
12
12
14

2. Setting Up a Development Server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
What Is a WAMP, MAMP, or LAMP?
Installing a WAMP on Windows
Testing the Installation
Alternative WAMPs

Installing a MAMP on Mac OS X
Configuring MySQL
Ensuring MySQL Starts on Booting
Testing the Installation
Installing a LAMP on Linux
Working Remotely
Logging In
Using FTP

16
16
28
31
31
35
36
36
38
38
38
39

v


Using a Program Editor
Using an IDE
Questions

40

41
43

3. Introduction to PHP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Incorporating PHP Within HTML
This Book’s Examples
The Structure of PHP
Using Comments
Basic Syntax
Variables
Operators
Variable Assignment
Multiple-Line Commands
Variable Typing
Constants
Predefined Constants
The Difference Between the echo and print Commands
Functions
Variable Scope
Questions

45
47
48
48
49
50
55
57
60

62
63
64
64
65
66
71

4. Expressions and Control Flow in PHP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Expressions
TRUE or FALSE?
Literals and Variables
Operators
Operator Precedence
Associativity
Relational Operators
Conditionals
The if Statement
The else Statement
The elseif Statement
The switch Statement
The ? Operator
Looping
while Loops
do ... while Loops
for Loops
Breaking Out of a Loop
The continue Statement

vi


|

Table of Contents

73
73
75
76
77
78
80
84
84
85
87
88
91
92
93
94
95
97
98


Implicit and Explicit Casting
PHP Dynamic Linking
Dynamic Linking in Action
Questions


98
99
100
101

5. PHP Functions and Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
PHP Functions
Defining a Function
Returning a Value
Returning an Array
Passing by Reference
Returning Global Variables
Recap of Variable Scope
Including and Requiring Files
The include Statement
Using include_once
Using require and require_once
PHP Version Compatibility
PHP Objects
Terminology
Declaring a Class
Creating an Object
Accessing Objects
Cloning Objects
Constructors
PHP 5 Destructors
Writing Methods
Static Methods in PHP 5
Declaring Properties

Declaring Constants
Property and Method Scope in PHP 5
Static Properties and Methods
Inheritance
Questions

104
106
106
108
108
110
111
111
111
112
112
113
113
114
115
116
116
118
119
120
120
121
122
122

123
124
125
129

6. PHP Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Basic Access
Numerically Indexed Arrays
Associative Arrays
Assignment Using the array Keyword
The foreach ... as Loop
Multidimensional Arrays

131
131
133
134
135
137

Table of Contents

|

vii


Using Array Functions
is_array
count

sort
shuffle
explode
extract
compact
reset
end
Questions

140
140
140
140
141
141
142
143
144
144
144

7. Practical PHP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Using printf
Precision Setting
String Padding
Using sprintf
Date and Time Functions
Date Constants
Using checkdate
File Handling

Checking Whether a File Exists
Creating a File
Reading from Files
Copying Files
Moving a File
Deleting a File
Updating Files
Locking Files for Multiple Accesses
Reading an Entire File
Uploading Files
System Calls
XHTML or HTML5?
Questions

147
148
150
151
151
154
154
155
155
155
157
158
158
158
159
160

162
162
167
169
169

8. Introduction to MySQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
MySQL Basics
Summary of Database Terms
Accessing MySQL via the Command Line
Starting the Command-Line Interface
Using the Command-Line Interface
MySQL Commands

viii

|

Table of Contents

171
172
172
173
177
178


Data Types
Indexes

Creating an Index
Querying a MySQL Database
Joining Tables Together
Using Logical Operators
MySQL Functions
Accessing MySQL via phpMyAdmin
Using phpMyAdmin
Questions

183
192
192
198
207
209
209
210
214
214

9. Mastering MySQL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Database Design
Primary Keys: The Keys to Relational Databases
Normalization
First Normal Form
Second Normal Form
Third Normal Form
When Not to Use Normalization
Relationships
One-to-One

One-to-Many
Many-to-Many
Databases and Anonymity
Transactions
Transaction Storage Engines
Using BEGIN
Using COMMIT
Using ROLLBACK
Using EXPLAIN
Backing Up and Restoring
Using mysqldump
Creating a Backup File
Restoring from a Backup File
Dumping Data in CSV Format
Planning Your Backups
Questions

217
218
219
220
222
224
226
227
227
228
229
230
230

231
232
232
233
234
235
235
237
239
239
240
240

10. Accessing MySQL Using PHP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Querying a MySQL Database with PHP
The Process
Creating a Login File

241
242
242

Table of Contents

|

ix


Connecting to MySQL

A Practical Example
The $_POST Array
Deleting a Record
Displaying the Form
Querying the Database
Running the Program
Practical MySQL
Creating a Table
Describing a Table
Dropping a Table
Adding Data
Retrieving Data
Updating Data
Deleting Data
Using AUTO_INCREMENT
Performing Additional Queries
Preventing SQL Injection
Using Placeholders
Preventing HTML Injection
Questions

243
248
251
252
252
253
254
255
255

256
257
257
258
259
260
260
262
263
265
266
268

11. Using the mysqli Extension. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
Querying a MySQL Database with mysqli
Creating a Login File
Connecting to MySQL
A Practical Example
Using mysqli Procedurally
Questions

269
269
270
274
276
277

12. Form Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Building Forms

Retrieving Submitted Data
register_globals: An Old Solution Hangs On
Default Values
Input Types
Sanitizing Input
An Example Program
What’s New in HTML5?
The autocomplete Attribute
The autofocus Attribute
The placeholder Attribute

x

|

Table of Contents

279
281
282
283
284
291
292
295
295
295
296



The required Attribute
Override Attributes
The width and height Attributes
Features Awaiting Full Implementation
The form Attribute
The list Attribute
The min and max Attributes
The step Attribute
The color Input Type
The number and range Input Types
Date and time Pickers
Questions

296
296
297
297
297
297
298
298
298
298
298
299

13. Cookies, Sessions, and Authentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Using Cookies in PHP
Setting a Cookie
Accessing a Cookie

Destroying a Cookie
HTTP Authentication
Storing Usernames and Passwords
Salting
Using Sessions
Starting a Session
Ending a Session
Setting a Timeout
Session Security
Questions

301
303
304
304
304
307
308
312
312
315
317
317
320

14. Exploring JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
JavaScript and HTML Text
Using Scripts Within a Document Head
Older and Nonstandard Browsers
Including JavaScript Files

Debugging JavaScript Errors
Using Comments
Semicolons
Variables
String Variables
Numeric Variables
Arrays
Operators
Arithmetic Operators

324
325
325
326
327
329
329
330
330
330
331
332
332

Table of Contents

|

xi



Assignment Operators
Comparison Operators
Logical Operators
Variable Incrementing and Decrementing
String Concatenation
Escaping Characters
Variable Typing
Functions
Global Variables
Local Variables
The Document Object Model
But It’s Not That Simple
Another Use for the $ Symbol
Using the DOM
Questions

332
333
333
334
334
334
335
336
336
336
338
340
340

341
342

15. Expressions and Control Flow in JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
Expressions
Literals and Variables
Operators
Operator Precedence
Associativity
Relational Operators
The with Statement
Using onerror
Using try ... catch
Conditionals
The if Statement
The else Statement
The switch statement
The ? Operator
Looping
while Loops
do ... while Loops
for Loops
Breaking Out of a Loop
The continue Statement
Explicit Casting
Questions

343
344
345

346
346
347
350
351
352
353
353
353
354
355
356
356
357
357
358
359
360
360

16. JavaScript Functions, Objects, and Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
JavaScript Functions

xii

|

Table of Contents

363



Defining a Function
The arguments Array
Returning a Value
Returning an Array
JavaScript Objects
Declaring a Class
Creating an Object
Accessing Objects
The prototype Keyword
JavaScript Arrays
Numeric Arrays
Associative Arrays
Multidimensional Arrays
Using Array Methods
Questions

363
364
365
367
368
368
369
370
370
372
373
374

375
376
380

17. JavaScript and PHP Validation and Error Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
Validating User Input with JavaScript
The validate.html Document (Part One)
The validate.html Document (Part Two)
Regular Expressions

381
382
384
387
388
395
396
397
403

Using Regular Expressions in JavaScript
Using Regular Expressions in PHP
Redisplaying a Form After PHP Validation
Questions

18. Using Ajax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
What Is Ajax?
Using XMLHttpRequest
Your First Ajax Program
Using GET Instead of POST

Sending XML Requests
Using Frameworks for Ajax
Questions

405
406
408
413
415
420
421

19. Introduction to CSS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Importing a Style Sheet
Importing CSS from Within HTML
Embedded Style Settings
Using IDs
Using Classes

424
424
425
425
425

Table of Contents

|

xiii



Using Semicolons
CSS Rules
Multiple Assignments
Using Comments
Style Types
Default Styles
User Styles
External Style Sheets
Internal Styles
Inline Styles
CSS Selectors
The Type Selector
The Descendant Selector
The Child Selector
The ID Selector
The Class Selector
The Attribute Selector
The Universal Selector
Selecting by Group
The CSS Cascade
Style Sheet Creators
Style Sheet Methods
Style Sheet Selectors
Calculating Specificity
The Difference Between Div and Span Elements
Measurements
Fonts and Typography
font-family

font-style
font-size
font-weight
Managing Text Styles
Decoration
Spacing
Alignment
Transformation
Indenting
CSS Colors
Short Color Strings
Gradients
Positioning Elements
Absolute Positioning

xiv

|

Table of Contents

426
426
426
427
428
428
428
429
429

430
430
430
430
431
432
433
434
434
435
435
436
436
437
437
439
440
442
442
443
443
444
444
445
445
446
446
446
447
447

448
449
449


Relative Positioning
Fixed Positioning
Pseudo-Classes
Shorthand Rules
The Box Model and Layout
Setting Margins
Applying Borders
Adjusting Padding
Object Contents
Questions

450
450
452
454
454
455
457
458
459
459

20. Advanced CSS with CSS3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
Attribute Selectors
The ^ Operator

The $ Operator
The * Operator
The box-sizing Property
CSS3 Backgrounds
The background-clip Property
The background-origin Property
The background-size Property
Multiple Backgrounds
CSS3 Borders
The border-color Property
The border-radius Property
Box Shadows
Element Overflow
Multicolumn Layout
Colors and Opacity
HSL Colors
HSLA Colors
RGB Colors
RGBA Colors
The opacity Property
Text Effects
The text-shadow Property
The text-overflow Property
The word-wrap Property
Web Fonts
Google Web Fonts
Transformations
3D Transformations

461

462
462
463
463
463
464
465
466
467
469
469
469
472
473
473
475
475
476
476
477
477
477
477
478
479
479
480
481
483


Table of Contents

|

xv


Transitions
Properties to Transition
Transition Duration
Transition Delay
Transition Timing
Shorthand Syntax
Questions

483
484
484
484
485
485
487

21. Accessing CSS from JavaScript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Revisiting the getElementById Function
The O function
The S Function
The C Function
Including the Functions
Accessing CSS Properties from JavaScript

Some Common Properties
Other Properties
Inline JavaScript
The this Keyword
Attaching Events to Objects in a Script
Attaching to Other Events
Adding New Elements
Removing Elements
Alternatives to Adding and Removing Elements
Using Interrupts
Using setTimeout
Canceling a Timeout
Using setInterval
Using Interrupts for Animation
Questions

489
489
490
491
492
493
494
495
497
497
498
499
500
501

502
503
503
504
504
506
508

22. Introduction to HTML5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509
The Canvas
Geolocation
Audio and Video
Forms
Local Storage
Web Workers
Web Applications
Microdata
Summary

xvi

|

Table of Contents

510
511
513
514
515

515
515
516
516


Questions

516

23. The HTML5 Canvas. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
Creating and Accessing a Canvas
The toDataURL Function
Specifying an Image Type
The fillRect Method
The clearRect Method
The strokeRect Method
Combining These Commands
The createLinearGradient Method
The addColorStop Method in Detail
The createRadialGradient Method
Using Patterns for Fills
Writing Text to the Canvas
The strokeText Method
The textBaseLine Property
The font Property
The textAlign Property
The fillText Method
The measureText Method
Drawing Lines

The lineWidth Property
The lineCap and lineJoin Properties
The miterLimit Property
Using Paths
The moveTo and LineTo Methods
The stroke Method
The rect Method
Filling Areas
The clip Method
The isPointInPath Method
Working with Curves
The arc Method
The arcTo Method
The quadraticCurveTo Method
The bezierCurveTo Method
Manipulating Images
The drawImage Method
Resizing an Image
Selecting an Image Area
Copying from a Canvas

517
519
521
521
521
522
522
523
525

526
528
530
530
531
531
531
532
533
533
533
533
535
536
536
537
537
537
539
542
543
543
546
547
548
549
549
550
550
552


Table of Contents

|

xvii


Adding Shadows
Editing at the Pixel Level
The getImageData Method
The data Array
The putImageData Method
The createImageData Method
Advanced Graphical Effects
The globalCompositeOperation Property
The globalAlpha Property
Transformations
The scale Method
The save and restore Methods
The rotate Method
The translate Method
The transform Method
The setTransform Method
Summary
Questions

552
554
554

555
557
557
558
558
561
561
561
562
562
564
565
567
567
567

24. HTML5 Audio and Video. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
About Codecs
The <audio> Element
Supporting Non-HTML5 Browsers
The <video> Element
The Video Codecs
Supporting Older Browsers
Summary
Questions

570
571
573
574

575
578
580
580

25. Other HTML5 Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581
Geolocation and the GPS Service
Other Location Methods
Geolocation and HTML5
Local Storage
Using Local Storage
The localStorage Object
Web Workers
Offline Web Applications
Drag and Drop
Cross Document Messaging
Microdata
Other HTML5 Tags

xviii

|

Table of Contents

581
582
583
586
587

587
589
591
593
595
598
601


Summary
Questions

601
602

26. Bringing It All Together. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
Designing a Social Networking Site
On the Website
functions.php
The Functions
header.php
setup.php
index.php
signup.php
Checking for Username Availability
Logging In
checkuser.php
login.php
profile.php
Adding the “About Me” Text

Adding a Profile Image
Processing the Image
Displaying the Current Profile
members.php
Viewing a User’s Profile
Adding and Dropping Friends
Listing All Members
friends.php
messages.php
logout.php
styles.css
javascript.js

603
604
604
605
607
608
610
610
611
611
614
615
617
618
618
618
619

622
622
622
622
625
628
631
632
636

A. Solutions to the Chapter Questions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
B. Online Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
C. MySQL’s FULLTEXT Stopwords. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 663
D. MySQL Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
Index. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677

Table of Contents

|

xix



Preface

The combination of PHP and MySQL is the most convenient approach to dynamic,
database-driven web design, holding its own in the face of challenges from integrated
frameworks—such as Ruby on Rails—that are harder to learn. Due to its open source
roots (unlike the competing Microsoft .NET Framework), it is free to implement and

is therefore an extremely popular option for web development.
Any would-be developer on a Unix/Linux or even a Windows/Apache platform will
need to master these technologies. And, combined with the partner technologies of
JavaScript, CSS, and HTML5, you will be able to create websites of the caliber of industry
standards like Facebook, Twitter, and Gmail.

Audience
This book is for people who wish to learn how to create effective and dynamic websites.
This may include webmasters or graphic designers who are already creating static web‐
sites but wish to take their skills to the next level, as well as high school and college
students, recent graduates, and self-taught individuals.
In fact, anyone ready to learn the fundamentals behind the Web 2.0 technology known
as Ajax will obtain a thorough grounding in all of these core technologies: PHP, MySQL,
JavaScript, CSS, and HTML5.

Assumptions This Book Makes
This book assumes that you have a basic understanding of HTML and can at least put
together a simple, static website, but does not assume that you have any prior knowledge
of PHP, MySQL, JavaScript, CSS, or HTML5—although if you do, your progress through
the book will be even quicker.

xxi


Organization of This Book
The chapters in this book are written in a specific order, first introducing all of the core
technologies it covers and then walking you through their installation on a web devel‐
opment server so that you will be ready to work through the examples.
In the first section, you will gain a grounding in the PHP programming language, cov‐
ering the basics of syntax, arrays, functions, and object-oriented programming.

Then, with PHP under your belt, you will move on to an introduction to the MySQL
database system, where you will learn everything from how MySQL databases are struc‐
tured to how to generate complex queries.
After that, you will learn how you can combine PHP and MySQL to start creating your
own dynamic web pages by integrating forms and other HTML features. Following that,
you will get down to the nitty-gritty practical aspects of PHP and MySQL development
by learning a variety of useful functions and how to manage cookies and sessions, as
well as how to maintain a high level of security.
In the next few chapters, you will gain a thorough grounding in JavaScript, from simple
functions and event handling to accessing the Document Object Model and in-browser
validation and error handling.
With an understanding of all three of these core technologies, you will then learn how
to make behind-the-scenes Ajax calls and turn your websites into highly dynamic en‐
vironments.
Next, you’ll spend two chapters learning all about using CSS to style and lay out your
web pages, before moving on to the final section on the new features built into HTML5,
including geolocation, audio, video, and the canvas. After this, you’ll put together ev‐
erything you’ve learned in a complete set of programs that together constitute a fully
functional social networking website.
Along the way, you’ll also find plenty of pointers and advice on good programming
practices and tips that could help you find and solve hard-to-detect programming er‐
rors. There are also plenty of links to websites containing further details on the topics
covered.

Supporting Books
Once you have learned to develop using PHP, MySQL, JavaScript, CSS, and HTML5,
you will be ready to take your skills to the next level using the following O’Reilly refer‐
ence books. To learn more about any of these titles, simply search the O’Reilly website
or any good online book seller’s website:


xxii

| Preface


• Dynamic HTML: The Definitive Reference by Danny Goodman
• PHP in a Nutshell by Paul Hudson
• MySQL in a Nutshell by Russell J.T. Dyer
• JavaScript: The Definitive Guide by David Flanagan
• CSS: The Definitive Guide by Eric A. Meyer
• HTML5: The Missing Manual by Matthew MacDonald

Conventions Used in This Book
The following typographical conventions are used in this book:
Plain text
Indicates menu titles, options, and buttons.
Italic
Indicates new terms, URLs, email addresses, filenames, file extensions, pathnames,
directories, and Unix utilities.
Constant width

Indicates command-line options, variables and other code elements, HTML tags,
macros, and the contents of files.
Constant width bold

Shows program output or highlighted sections of code that are being discussed in
the text.
Constant width italic

Shows text that should be replaced with user-supplied values.

This element signifies a tip, suggestion, or general note.

This element indicates a warning or caution.

Preface

|

xxiii


×