| |
| |
Foreword | |
| |
| |
Preface | |
| |
| |
Acknowledgments | |
| |
| |
| |
Perl, CGI, and this Book | |
| |
| |
| |
What Is Perl? | |
| |
| |
| |
What Is CGI? | |
| |
| |
| |
Why Perl Is Good for CGI | |
| |
| |
| |
About this Book | |
| |
| |
| |
Who Is this Book For? | |
| |
| |
| |
Conventions Used in this Book | |
| |
| |
| |
Using perldoc | |
| |
| |
| |
Using the CPAN | |
| |
| |
| |
What You Should Know | |
| |
| |
| |
Prerequisites | |
| |
| |
| |
Editors | |
| |
| |
| |
File Permissions | |
| |
| |
| |
Basic Security Concerns | |
| |
| |
| |
Using -T | |
| |
| |
| |
Checking for Taintedness and Laundering Data | |
| |
| |
| |
Your PATH and -T | |
| |
| |
| |
Installing a Script | |
| |
| |
| |
Troubleshooting | |
| |
| |
| |
Caching | |
| |
| |
| |
The Expires HTTP Header | |
| |
| |
| |
Cache-Control HTTP Header | |
| |
| |
| |
Listings | |
| |
| |
| |
Using Your Environment | |
| |
| |
| |
Introduction to %ENV | |
| |
| |
| |
Adding to %ENV | |
| |
| |
| |
Form Input Primer | |
| |
| |
| |
Example Script: Visitor Log | |
| |
| |
| |
Example Script: Basic Report | |
| |
| |
| |
Reader Exercise | |
| |
| |
| |
What Have We Learned? | |
| |
| |
| |
Listings | |
| |
| |
| |
Introduction to Web Forms | |
| |
| |
| |
Introduction | |
| |
| |
| |
Form Tags | |
| |
| |
| |
Reading Form Input with CGI.pm | |
| |
| |
| |
Making Your Users Happy | |
| |
| |
| |
Final Example | |
| |
| |
| |
User Exercises | |
| |
| |
| |
Program Listings | |
| |
| |
| |
Working with Cookies | |
| |
| |
| |
Introduction | |
| |
| |
| |
Security | |
| |
| |
| |
Limitations | |
| |
| |
| |
Cookie Pieces | |
| |
| |
| |
Working with Cookies the Manual Way | |
| |
| |
| |
Baking Cookies with CGI.pm | |
| |
| |
| |
Controlling User Preferences with Cookies | |
| |
| |
| |
User Exercises | |
| |
| |
| |
Access Counters | |
| |
| |
| |
Introduction | |
| |
| |
| |
Example Script: SSI Text Counter | |
| |
| |
| |
Example Script: SSI Image Counter | |
| |
| |
| |
Example Script: SSI Text Counter, with a Twist | |
| |
| |
| |
Example Script: An Imageless Image Counter | |
| |
| |
| |
Counter Conclusion | |
| |
| |
| |
Reader Exercises | |
| |
| |
| |
Listings | |
| |
| |
| |
Web-Based File Uploading | |
| |
| |
| |
Introduction | |
| |
| |
| |
File Uploading Basics | |
| |
| |
| |
Viewing Files | |
| |
| |
| |
Uploading Multiple Files | |
| |
| |
| |
Reader Exercises | |
| |
| |
| |
File Listings | |
| |
| |
| |
Tracking Clicks | |
| |
| |
| |
Introduction | |
| |
| |
| |
Example Script: A Simple Click Tracker | |
| |
| |
| |
Example Script: Random Images | |
| |
| |
| |
Example Script: Click Tracking (Reprise) | |
| |
| |
| |
Reader Exercises | |
| |
| |
| |
Listings | |
| |
| |
| |
Using mod_perl | |
| |
| |
| |
What Is mod_perl? | |
| |
| |
| |
Configuring mod_perl | |
| |
| |
| |
Apache::Registry | |
| |
| |
| |
Automatic Headers and Footers with Apache::Sandwich | |
| |
| |
| |
A mod_perl Photo Album with Apache::Album | |
| |
| |
| |
Authentication with Apache::AuthDBI | |
| |
| |
| |
Writing a mod_perl Handler | |
| |
| |
| |
Reader Exercises | |
| |
| |
| |
Listings | |
| |
| |
| |
Web-Based E-mail | |
| |
| |
| |
Introduction | |
| |
| |
| |
Example Script: Checking POP3 Mail via the Web | |
| |
| |
| |
Example Script: Reading E-mail via the Web | |
| |
| |
| |
Example Script: Displaying Attachments | |
| |
| |
| |
Example Script: Composing E-mail | |
| |
| |
| |
Reader Exercises | |
| |
| |
| |
Listings | |
| |
| |
| |
Introduction to DBI and Databases on the Web | |
| |
| |
| |
Introduction | |
| |
| |
| |
Using the Perl DBI | |
| |
| |
| |
Connecting to the Database | |
| |
| |
| |
Disconnecting from the Database | |
| |
| |
| |
Preparing and Executing an SQL Query | |
| |
| |
| |
Fetching Data | |
| |
| |
| |
The fetchall_arrayref() Method | |
| |
| |
| |
The fetchrow_arrayref() Method | |
| |
| |
| |
The fetchrow_hashref() Method | |
| |
| |
| |
The bind_columns() Method | |
| |
| |
| |
Putting It All Together | |
| |
| |
| |
The do() Method | |
| |
| |
| |
Wrapping It Up | |
| |
| |
| |
Reader Exercises | |
| |
| |
| |
Listings | |
| |
| |
| |
Tied Variables | |
| |
| |
| |
Introduction | |
| |
| |
| |
Setting It All Up | |
| |
| |
| |
Getting Started | |
| |
| |
| |
Diving In | |
| |
| |
| |
The Main Program | |
| |
| |
| |
Finishing the ShopCart Module | |
| |
| |
| |
Running the Program | |
| |
| |
| |
Wrapping It Up | |
| |
| |
| |
Program Listings | |
| |
| |
| |
Embedding Perl in HTML with Mason | |
| |
| |
| |
Introduction | |
| |
| |
| |
Installation | |
| |
| |
| |
The Strategy | |
| |
| |
| |
Mason Syntax | |
| |
| |
| |
Special Mason Components | |
| |
| |
| |
Cascading Execution | |
| |
| |
| |
Moving Right Along | |
| |
| |
| |
rss2html | |
| |
| |
| |
my_news | |
| |
| |
| |
footer | |
| |
| |
| |
Wrapping It Up: The Code for the Example Site | |
| |
| |
| |
Document Management via the Web | |
| |
| |
| |
Introduction | |
| |
| |
| |
The Plan | |
| |
| |
| |
auth.cgi | |
| |
| |
| |
shared.pl | |
| |
| |
| |
main.cgi | |
| |
| |
| |
upload.cgi | |
| |
| |
| |
viewer.cgi | |
| |
| |
| |
Program Listings | |
| |
| |
| |
Dynamically Manipulating Images | |
| |
| |
| |
Introduction | |
| |
| |
| |
Adding Shapes and Text | |
| |
| |
| |
Creating a Dynamic Graph | |
| |
| |
| |
Creating Thumbnail Images | |
| |
| |
| |
Filtering Images with Image::Magick | |
| |
| |
| |
Animated Images | |
| |
| |
| |
Reader Exercises | |
| |
| |
| |
Listings | |
| |
| |
| |
RSS And XML | |
| |
| |
| |
XML and RSS Overview | |
| |
| |
| |
Structure of an XML Document | |
| |
| |
| |
News Portals with RSS | |
| |
| |
| |
A Home Page News Portal | |
| |
| |
| |
Creating an RSS File | |
| |
| |
| |
Reader Exercises | |
| |
| |
| |
Listings | |
| |
| |
| |
Server Codes | |
| |
| |
100-199: Provide confirmation that a request is being processed | |
| |
| |
200-299: Request was performed | |
| |
| |
300-399: Request not performed | |
| |
| |
400-499: Request is incomplete | |
| |
| |
500-599: Internal server errors | |
| |
| |
| |
Environment Variables | |
| |
| |
| |
POSIX::strftime() Formats | |
| |
| |
| |
General Public License | |
| |
| |
| |
Artistic License | |
| |
| |
| |
Perl Documentation | |
| |
| |
| |
ASCII Codes | |
| |
| |
| |
Special HTML Characters | |
| |
| |
Resources | |
| |
| |
Index | |