search for books and compare prices
Tables of Contents for Cgi Fast & Easy Web Development
Chapter/Section Title
Page #
Page Count
Introduction
xvii
 
PART I CGI: AN INTRODUCTION
1
78
CGI and the Web
3
20
What Is CGI?
4
5
Why Use CGI?
5
2
Why Is CGI Important to the Web Designer?
7
1
Who Uses CGI?
8
1
CGI Basics
9
3
What You Need to Run CGI Applications
10
1
CGI Server Requirements
11
1
Getting Started with CGI
12
4
Creating Your cgi-bin
12
4
CGI Programming Languages
16
2
Your Choices
16
1
The Most Popular CGI Language: Perl
16
2
Preparing Your Web Page for CGI
18
3
Summary
21
2
Writing Your CGI Application
23
26
Planning Ahead Is Important
24
11
Using Multiple Languages
24
1
Using Multiple HTML Pages
25
3
Adopting Proper Form Design
28
1
Planning the Database Design
29
3
Writing Pseudocode
32
3
Learning the Programming Basics
35
13
Understanding the Difference Between Programs and Scripts
36
1
Learning the Perl Basics
36
12
Summary
48
1
Your First CGI Application
49
30
Creating Your Application Using Perl
50
16
Adding Comments to Your Application
50
3
Creating Your Application on a PC or Mac
53
9
Creating Your Application on a UNIX Server
62
2
Changing the Permissions of Your Application
64
2
Starting Your CGI Application Using Perl
66
9
Finding Perl on Your Server
66
2
Using the Interpreter's Location in Your Application
68
1
Writing Your Perl Code
69
6
Running Your CGI Application
75
2
Using the URL to Run the Application
75
1
Using a Test HTML Form to Run the Application
76
1
Summary
77
2
PART II BASIC DATA
79
184
Getting the Data from Visitors to Your Web Page
81
42
Gathering Data from Your Visitors
82
3
Using Data Labels
82
1
Using Name Attributes or HTML Labels
83
2
Developing Your HTML Form
85
26
Using Text Input Fields
85
8
Using Selected Choice Inputs
93
7
Creating Action Buttons
100
6
Adding Default Values to Your Forms
106
2
Adding Links to Your Forms
108
3
Using Environment Variables
111
10
Using Post versus Get
111
6
Determining Browser and Platform Information
117
2
Determining Navigation Information
119
1
Viewing All Environment Variables at Once
120
1
Summary
121
2
Getting the Data Into Your CGI Application
123
25
The Importance of the Data in Your Application
124
1
The Ability to Interact
124
1
The Means of Communicating with Your Visitors
124
1
Inputting User Data
125
12
Parsing Data from Forms and Links
125
11
Inputting Data from Environment Variables
136
1
Inputting Data Yourself
137
8
Inputting Data from Scalars
138
1
Inputting Data from Arrays
139
3
Inputting Data from Hashes
142
3
Dealing with Potential Problems
145
2
Incorrect Input from Your Users
145
1
Faulty Data that You Input
146
1
Summary
147
1
Scalars
148
25
Storing Scalar Information
149
3
Initial Data
149
1
Results of Operations
150
2
Using Numbers as Scalar Variables
152
12
Addition
152
2
Subtraction
154
1
Multiplication
155
4
Division
159
3
Using Multiple Operators
162
2
Using Strings as Scalar Variables
164
3
Connecting Strings
164
2
Repeating Strings
166
1
Assigning Values to a Variable
167
5
Manipulating Variable Values
168
4
Summary
172
1
Arrays
173
37
Splitting a Scalar Into an Array
174
3
Reasons for Splitting a Scalar
174
1
The Process of Splitting a Scalar
175
2
Determining the Length of an Array
177
4
Using a Scalar Variable
177
2
Using the Index Number
179
2
Retrieving Array Data
181
10
Retrieving a Specific Item
182
4
Retrieving Multiple Items
186
5
Modifying an Array
191
16
Modifying the Entire Array
191
4
Adding Elements to an Array
195
4
Removing Array Elements
199
4
Replacing Array Elements
203
3
Reversing the Order of Elements
206
1
Manipulating Arrays
207
2
Combining Arrays
207
1
Sorting Arrays
208
1
Summary
209
1
Hashes
210
23
Checking for the Existence of a Key
211
3
Why Checking Is Important
211
1
How to Check for a Key
211
3
Retrieving Hash Values Using Keys
214
4
Retrieving a Single Value
214
2
Retrieving Multiple Values
216
2
Retrieving All the Hash Data
218
3
Finding All Hash Values
218
1
All Hash Keys
219
2
Retrieving Specific Keys and Values
221
7
Retrieving the First Key and Value
221
3
Retrieving Each Key and Value
224
1
Retrieving Key-Value Pairs with the Keys Function
225
3
Removing Key-Value Pairs
228
4
Summary
232
1
Conditional Statements
233
30
Comparing Values
234
5
Number Comparison
234
1
String Comparison
235
2
Evaluating without Comparisons
237
1
Checking Multiple Comparisons
237
2
Creating Your Conditional Statement
239
6
Using Conditional Statement Blocks
245
17
The if/unless Statement
245
3
The while/until Statement
248
3
The do { } while/until Statement
251
4
The for Statement
255
3
The foreach Statement
258
2
Nested Conditional Statements
260
2
Summary
262
1
PART III ADVANCED DATA
263
146
Handling Data with Regular Expressions
265
30
Using Regular Expressions
266
1
Matching Text Patterns
267
10
Single Character Patterns
267
4
Group Patterns
271
3
Anchor Patterns
274
3
Precedence
277
1
Using the Matching Operator
277
10
Choosing a Different Target
278
2
Ignoring String Case
280
2
Using Different Delimiters
282
2
Variable Interpolation
284
3
Making Substitutions with Regular Expressions
287
4
Advanced Substitutions
288
3
Using the Split Function
291
3
Summary
294
1
Subroutines
295
15
Creating a Subroutine
296
2
A Basic Subroutine
296
1
A Subroutine that Requires Input
297
1
Storing a Subroutine
298
1
Calling a Subroutine
299
5
Calling a Basic Subroutine
300
1
Calling a Subroutine that Requires Input
300
3
Calling a Subroutine from an External File
303
1
Subroutine Return Values
304
5
Using the Subroutine Return Value
305
2
Manually Setting the Return Value
307
2
Summary
309
1
Retaining Visitor Data
310
23
Creating Hidden Fields
311
5
Adding Hidden Fields to Your Form
311
2
Using a Hidden Field to Store Collected Data
313
3
Understanding Cookies
316
16
Setting Cookies
317
8
Reading Your Cookies
325
1
Tossing Your Cookies
326
2
Putting It All Together
328
4
Summary
332
1
Outputting Data
333
26
Generating STDOUT Output
334
5
Normal Output Using print
334
2
Formatted Output Using printf
336
3
Generating HTML Formatted Output
339
4
Adding HTML Formats to Output
339
1
Printing Multiple Lines
340
2
Image and Path Links
342
1
Generating Header and Footer Subroutines
343
5
Creating Header and Footer Subroutines
344
2
Calling Header Subroutines
346
1
Calling Footer Subroutines
347
1
Generating Table and List Outputs
348
4
Outputting a Hash as a Table
349
2
Outputting an Array as a List
351
1
Formatting Numbers and Strings
352
5
Printing Formatted Data
353
1
Formatting Numbers as Dollars and Cents
354
2
Padding Numbers
356
1
Summary
357
2
Formats
359
21
Using Formats
360
4
Defining a Format
361
2
Invoking a Format
363
1
Using Fields
364
9
Text Fields
368
1
Numeric Fields
369
1
Multiline Fields
370
2
Filled Fields
372
1
Using the Top-of-Page Format
373
3
Changing Format Defaults
376
3
Changing the Format Names
376
2
Changing the Page Length
378
1
Summary
379
1
Files and Directories
380
29
Using Files
381
17
Opening Files
381
5
Closing Files
386
1
Writing to Files
387
1
Reading Data from Files
388
2
Exclusive File Access
390
1
Renaming Files
391
3
Removing Files
394
1
Checking the Status of Files
395
3
Using Directories
398
6
Opening Directories
398
1
Closing Directories
399
1
Viewing Directory Contents
400
1
Changing the Directory
401
1
Creating New Directories
402
1
Removing Directories
403
1
Using File and Directory Operations
404
4
Verifying Files and Directories
404
1
Changing Permissions In Your Application
405
1
Eliminating Characters
406
2
Summary
408
1
PART IV APPENDIXES
409
27
Appendix A Debugging Your Application
411
21
Understanding Debugging
412
1
Deciphering Error Messages
413
1
The Dreaded 500 Internal Server Error
414
5
403 Forbidden
419
1
The Document Contained No Data
419
4
404 File Not Found
423
1
Using Other Valuable Debugging Tools
424
1
Using Error Subroutines
424
7
Summary
431
1
Appendix B What's On the CD-ROM
432
4
Running the CD
433
1
Linux
433
1
Windows 95/98/2000/NT
433
1
The Prima License
434
1
The Prima User Interface
434
1
Resizing and Closing the User Interface
434
1
Using the Left Panel
434
1
Using the Right Panel
435
1
Index
436