Instant Web Scripts with CGI/PERL Instant Web Scripts With CGI (Table of Contents)

Disclaimer: This book was published about seven years ago and details technologies that, while cutting-edge in their day, have become partially outdated now.

If you are looking for the most recent technology documentation, try reading Instant CGI/Perl.

That said, there is a lot of interesting and useful information contained here that might be fascinating from a historical perspective or from a general software engineering perspective. So if you keep this in mind and are still interested in the content, feel free to read further.

This book is available from your local book chain or available online from MIS Press has kindly given me permission to publish one chapter per month on the web.

Get Acrobat Today! Reviews

Small Computer Book Club
Diablo Valley MUG



Who This Book is For
What Do You Need To Know To Start
Why Perl?
Perl is the Right Tool for the Job (CGI as a Translator, CGI Across Platform)
Perl is Easy
How This Book is Structured
The Overview
Installation and Usage
The Design Discussion
Your Path Through the Parts
Quick Discussion of Each Part and Chapter
Some Closing Words

Part One: Building, Using, and Installing Scripts

Chapter 1 Getting and Setting up Your Scripts
Where to find CGI applications
Installing a Pre-Designed CGI Application
Gzip, Tar, and Compress
Setting the Correct Permissions
Server-based CGI Execution Issues
Finding System Files
Cross Platform Considerations (NT as an Example)

Chapter 2 Trouble Shooting CGI Scripts.
Server Errors
Syntax Errors
Output Errors

Chapter 3 The Role of CGI in Intranet Design
The Intranet Bulletin Board
Groupware Calendar
Document Sharing
The Database Manager
Web Chat
Intranet Security Issues

Part Two CGI Libraries

Chapter 4 Using Libraries
All about algorithms
Application Specific Subroutines
Inter-Application Libraries

Chapter 5 Using to Write CGI Scripts
Parsing Form Variables
Uploading Files using HTML
Printing HTML Information
Splitting Multi-valued Form Variables
Testing Which Form Method Was Used
Retrieving the Current URL
Printing CGI Errors
Printing Out Associative Arrays

Chapter 6 Performing Date Functions Using
Coverting Julian Dates
Converting Month Numbers
Converting Weekday Numbers
Obtaining Yesterday, Today and Tomorrow's Julian Date

Chapter 7 E-Mailing with CGI (
Sending E-mail (Basic)
Sending E-mail (Advanced)
When to use library vrs

Chapter 8 Connecting to Web Servers Using
How to Use
Using the HTTPGet Subroutine
Using the HTTPPost Subroutine
Using the FormatFormVars Subroutine
Using the RetrieveHTTP Subroutine
Using the OpenSocket Subroutine
Using the read_sock Subroutine
Using the web_error Subroutine

Chapter 9 Implementing Web Security Using AUTH-LIB.PL
Directory Structure and Permissions
Setting up Authentication Variables
Calling the Authentication Routines
Using the Sample Authentication Application

Chapter 10 Using cgi-lib.sol
Maintaining a Counter File
Handling Errors When Opening Files
Creating the HTML Header Tags
Creating Multiple Table Headers
Building A Select Tag
Building An HTML Input Form
Making a Form Row
Getting Rows From a Database
Outputting Multiple HTML Table Rows
Manipulating Lock Files
Part Three Databases

Chapter 11 Managing a Database
Directory Structure and Permissions
Server Specific Setup and Options
The Setup File
The Data File
Running the Script
Loading the Libraries and Setup Files
Authenticating Users
Displaying the Frontpage
Adding Database Rows
Modifying Database Rows
Deleting Database Rows
Viewing the Database
The CgiRequire Subroutine
The create_input_form Subroutine
The search_database Subroutine

Chapter 12 The Database Search Engine
Correct Directory Structure and Permissions
The Setup File
The Data File
Running the Script
Loading the Library Files and Setup Files
Displaying the Database Search Form
Searching the Database for Client-Submitted Keywords
Using the CgiRequire Subroutine

Chapter 13 The Groupware Calendar
Correct Directory Structure and Permissions
The Setup File
Running the Script
Loading the Supporting Libraries and Setup Files
Defining Intra-Screen Variables
Printing out the Calendar for the Current Month
Displaying a "Day View"
Authenticating the User
Adding Events
Modifying Events
Deleting Events
Using the make_month_array Subroutine
Using the Subroutines

Chapter 14 The Electronic Classified Ads
Correct Directory Structure and Permissions
The Setup File
The Data File
Running the Script
Loading the Supporting Libraries and Setup Files
Reformating Variables
Displaying the General Category Frontpage and Specific Category Frontpage
Adding Ads
Modifying Ads
Deleting Ads
Viewing Ads
Using the Supporting Subroutines

Chapter 15 SQL Database Address Book
Correct Directory Structure and Permissions
Preparing the Database
The Setup File
Running the Scripts
SQL Basics
Querying the Database
Modifying the Database
Deleting From the Database
Part Four Working With HTML

Chapter 16 Searching HTML Directories by Keyword

Chapter 17 The Shopping Cart
Directory Structure and Permissions
The Setup File
Writing Tagged HTML Pages: Navigation Pages, Product Pages, Order Form
Using Frames
Running the Script
Loading the Libraries
Creating and Pruning Unique Carts
Store Navigation
Displaying the Cart
Adding Items to the Cart
Modifyings
Deleteing from Carts
Finalizing the Order with Price Calculations
Using Subroutines

Chapter 18 Tracking Viewed pages

Chapter 19 The Form Processor
Directory Structure and Permissions
Creating the Tagged Form
The Setup Variables
Running the Script
Restricting Use by IP Address
Processing Required Fields and Field Order
Emailing Form Results to Administrator
Appending to the Form Results Database
Thanking the User
Using the Subroutines

Chapter 20 The Guestbook
Directory Structure and Permissions
The Setup File
The Guestbook File
Running the Script
Loading Supporting Files
Censoring Incoming Form Data
Checking Required Fields
Adding a Guestbook Entry
Emailing to the Guestbook Administrator
Thanking the Guest
Using the Subroutines
Part Five CGI-based Graphics and Animation

Chapter 21 Animating Text
Discussion of five basic text animation applications using nph

Chapter 22 Random Banner Genrator
Directory Structure and Permissions
The Setup Variables
Preparing the HTML File
Running the Script
Loading the Supporting Routines
Generating the Random Banner and Associated URL
Displaying the HTML Page With Banner Inserted
Part Six Miscellaneous Applications

Chapter 23 The Fortune Cookie
Directory Structure and Permissions
The Setup File
The Fortune File
Running the Script
Loading Libraries, Fortune File, and Utilizing Special Perl Functions
Sending out the NPH-Header
Getting a Random Fortune

Chapter 24 The Advertising Tracker

Chapter 25 The Message Board System

Chapter 26 Web Chat

Appendix A Perl Notes
Sending text to the Web browser (print, here documents, using qq, sprintf, formatting your output)
Scalar variables (what is, using, the "." operator, chopping, using length, manipulating substrings, naming conventions)
List Arrays (what is, using, number of elements in, adding elements, using splice, push, pop, shift and unshift)
Associative Arrays (what is, accessing, keys and values, adding to and deleting from)
Equality Operators
Pattern Matching with //
The =~ operator
Using the split and join functions
Statement blocks
Using the if, elsif, else and unless control statements
for loops
Using logical operators (&& and ||)
Formatting control structures
Opening and closing files
Reading a file line by line
Writing and appending to files
Deleting, renaming and changing the permissions of files
File tests
Getting information about a file with stat
Opening, reading and closing directories

Appendix B Perl Futures

Appendix C About the CD-ROM
Tarred version of the CDROM for UNIX
Zipped Version of the CDROM for Windows