search for books and compare prices
Tables of Contents for Cgi Programming 101
Chapter/Section Title
Page #
Page Count
Introduction
xv
 
Getting Started
1
12
Basics of a Perl Program
3
1
Basics of a CGI Program
3
1
Your First CGI Program
4
2
The CGI.pm Module
6
2
The Other Way To Use CGI.pm
8
5
Perl Variables
13
14
Scalars
13
2
Arrays
15
1
Getting Data Into And Out Of Arrays
16
1
Finding the Length of Arrays
17
1
Array Slices
18
1
Finding An Item In An Array
18
1
Sorting Arrays
19
1
Joining Array Elements Into A String
20
1
Array or List?
20
1
Hashes
21
2
Adding Items to a Hash
23
1
Determining Whether an Item Exists in a Hash
23
1
Deleting Items From a Hash
24
1
Values
24
1
Determining Whether a Hash is Empty
24
3
CGI Environment Variables
27
12
Referring Page
29
1
Remote Host Name, and Hostname Lookups
29
2
Detecting Browser Type
31
2
A Simple Form Using GET
33
2
param is NOT a Variable
35
4
Processing Forms and Sending Mail
39
12
The Old Way of Decoding Form Data
39
1
Guestbook Form
40
1
Sending Mail
41
4
Subroutines
45
1
Passing Arrays and Hashes to Subroutines
46
1
Subroutine Return Values
47
1
Return vs. Exit
48
1
Sendmail Subroutine
48
1
Sending Mail to More Than One Recipient
48
1
Defending Against Spammers
49
2
Advanced Forms and Perl Control Structures
51
12
If Conditions
51
2
Unless
53
1
Validating Form Data
54
1
Looping
55
1
Infinite Loops
56
1
Breaking from Loops
56
2
Handling Checkboxes
58
1
Handling Radio Buttons
59
2
Handling SELECT Fields
61
2
Reading and Writing Data Files
63
12
File Permissions
63
1
Opening Files
64
1
Guestbook Form with File Write
65
3
File Locking
68
1
Closing Files
69
1
Reading Files
70
1
Poll Program
71
4
Working With Strings
75
16
Comparing Strings
75
1
Finding (and Replacing) Substrings
76
1
Finding the Length of a String
77
1
Translation (Replacing Characters)
78
1
Changing Case
78
1
Chop and Chomp
78
1
Splitting Strings
79
1
Joining Strings
80
1
Reversing Strings
81
1
Quoting with qq and q
82
2
Creating A List of Strings with qw
84
2
Revising results.cgi to Show Percentages
86
5
Server-Side Includes
91
14
Apache SSI Reference
92
4
Including Files
96
2
Executing CGI Programs From Server-Side Includes
98
1
SSI Page Counter
98
1
Troubleshooting
99
1
Custom Error Page
100
1
SSI Error Logger
101
1
Passing Variables to a SSI-Invoked CGI Program
102
1
Executing Server Commands
103
1
Other Ways of Embedding Dynamic Content
104
1
Working With Numbers
105
12
Arithmetic Operators
105
1
Assignment Operators
105
1
Autoincrement and Autodecrement Operators
106
1
Rounding Floating-Point Numbers
106
1
Arithmetic Functions
107
1
Units Conversion
107
1
Random Numbers
108
1
Random Quotes Program
109
1
A Random Image Picker
109
1
Random URL
110
1
Random Ad Banner
111
3
Ad Tally Program
114
3
Redirection
117
8
Banner Ad Program, v.2: Counting Clicks
118
2
Redirect Based on Referrer
120
1
Custom Home Page Based on Visitor's Country
121
2
Site Redirector
123
2
Multi-Script Forms
125
12
Adding Product Categories
132
2
Accepting Credit Cards
134
3
Searching and Sorting
137
10
Searching by Looping
137
2
Searching With grep
139
3
Searching for Multiple Keywords
142
1
Sorting
143
3
Site-Wide Searching
146
1
Regular Expressions and Pattern Matching
147
10
Symbols for Regular Expression Patterns
147
2
Pattern Matching
149
1
Pattern Replacement
149
1
Negation
150
1
Validating E-Mail Addresses
150
2
Anchoring a Match
152
1
Substitutions
153
1
Stripping HTML Tags
154
1
Backreferences
154
1
Case-Insensitive Matching
155
1
Perl 5 vs. Perl 6
155
2
Perl Modules
157
20
Finding Modules
157
1
Installing Modules on Windows
158
1
Installing Modules on Unix (Interactive Mode)
159
1
Installing Modules on Unix (Manually)
159
1
Using Modules
160
1
Modifying the Guestbook Program to Validate E-Mail Addresses
161
1
Uploading Files from a Form
162
2
Finding Image Sizes
164
3
Manipulating Images
167
1
Graphical Counter Program
168
5
E-mailing Attachments
173
3
More Modules
176
1
Date and Time
177
12
Formatting Dates and Times
179
1
Date::Format
180
3
Date::Parse
183
1
Dates in the Past or Future
183
1
Leap Years
184
1
Countdown Clocks
184
2
Date::Calc
186
1
Other Date and Time Modules
187
2
Database Programming
189
20
MySQL
189
1
Creating Databases
190
1
Creating Tables
191
2
Altering A Table
193
1
Deleting A Table
194
1
Inserting Data into a Table
194
1
Selecting Data from a Table
194
2
Searching for Specific Records
196
1
Ordering the Results
197
1
Modifying Records
198
1
Deleting Records
198
1
The Perl DBI Module
198
4
Online Catalog
202
1
Selecting Data Using Placeholders
203
1
Inserting Data into a Table
204
1
Modifying (Updating) Data in a Record
204
1
Deleting Data
205
1
SQL Page Counter
205
2
Database Backups
207
1
Further Reading
208
1
HTTP Cookies
209
26
Cookie Parameters
209
1
How to Set Cookies
210
1
Setting Cookies with CGI.pm
211
2
How to Read Cookies
213
1
Deleting Cookies
214
1
Tracking Cookies
214
4
A Cookie-Based Shopping Cart
218
17
Writing Your Own Modules
235
10
Exporting Variables
236
1
Exporting Database Handles
237
1
The Shopping Cart Module
237
5
Writing Modules for Others
242
3
CGI Security
245
8
Tainted Data
245
1
Taint Checking
246
1
Untainting Data
247
3
Defending Against Spammers
250
1
Visible Source Code
251
2
Password Protection
253
26
Designing Password-Protected Sites
254
1
Basic HTTP Authentication
254
2
User Registration CGI Program
256
2
Authentication via Database: mod_auth_mysql
258
4
To Encrypt, or Not To Encrypt
262
1
Decrypting?
263
1
Resetting Passwords
264
3
Change Password
267
3
Cookie-Based Authentication
270
5
Password Maintenance
275
1
Logout Page
276
3
Conclusion
279
2
Appendix A: Unix Tutorial and Command Reference
281