Table of Contents
CGI Introduction
How This Book Came About
Intended Audience
How This Book Is Organized
Conventions Used in This Book
A Word from the Authors
CHAPTER 1
Introduction to CGI
CGI and the World Wide Web
Beyond HTML with CGI
How CGI Works
Where CGI Scripts Live
The Future of CGI Scripting
CHAPTER 2
Choosing Your CGI Tools
Interpreted Scripting Languages
Compiled Languages
Compiled Interpreted Scripting Languages
Picking the Best Language for Your Environment
CHAPTER 3
Designing CGI Applications
CGI Script Structure
Planning Your Script
Standard CGI Environment Variables
CGI Script Portability
CGI Libraries
CGI Limitations
CHAPTER 4
Understanding Basic CGI Elements
CGI Behind the Scenes
Environment Variables: Information for the Taking
Dealing with URL-Encoded Information
Use Your Header...
Returning Output to the Users
CHAPTER 5
Using HTML and CGI as a User Interface
Integrating CGI into Your HTML Pages
Creating the Marketing Questionnaire
The Good, the Bad, and the Ugly
CHAPTER 6
Examples of Simple CGI Scripts
E-Mail Gateways
Feedback or Comment Scripts
A Visitor Guest Book Script
Page-Hit Counters
Web-Based Bulletin-Board Systems
Web-Based Games
CHAPTER 7
Custom Scripts for Forms Processing
Secure Form Transactions
Configuring CGI with the NCSA Server
Configuring CGI with the CERN HTTPd Server
Configuring Netscape for CGI
Configuring CGI for Windows NT or Windows 95
Order Processing via Mail
Web Site Subscriptions
The Registration Page
CHAPTER 8
Modifying CGI Scripts
Installing and Modifying a Guestbook CGI Script
Defining System Variables
Setting Guestbook Script Options
Final Version of Guestbook
Converting a Guestbook CGI to a Friend's Web Site List
Modifying Compiled Page-Hit Counters
Modifying Flexible Page-Hit Counters
CHAPTER 9
How to Handle Custom Image Maps
How an Image Map Functions
Web Server Image Map Configurations
Client-Side Image Maps
Image Map Tools
Generating Images in Real Time
CHAPTER 10
Using MIME with CGI
What is MIME?
How MIME Became Part of the HTTP Specification
How MIME Is Used on the World Wide Web
Understanding MIME Content Types
Mapping MIME Types to Browser Helper Applications
Configuring a Server to Recognize MIME Types
Security Considerations with MIME
Content Negotiation Based on MIME
CHAPTER 11
Indexing a Web Site
A Brief Introduction to Searching
Search Functions as Part of Your Site
Simple Search Engines for Smaller Sites
An Overview of Search Engines for Business Sites
CHAPTER 12
Using WAIS with CGI
What Is WAIS?
Why Use WAIS?
Creating and Using a WAIS Database
WAIS Web Gateways (Scripts)
freeWAIS
For More Information...
CHAPTER 13
Custom Database Query Scripts
Fundamental Design and Security Issues
A Simple Working Example in Perl
Web/Database Tools
Problem Solving
The Future of Web/Database Interfaces 40
CHAPTER 14
Robots and Web Crawlers
Definition of Robots and Web Crawlers
Introduction to robot.txt
robots.txt Considerations
Where to Obtain Robots
Server Performance Considerations
IP Bandwidth Considerations
Robot Etiquette
Interfacing with Other Web Crawlers
CHAPTER 15
Generating HTML Documents in Real Time
Static HTML
Real-Time HTML
Near Real-Time HTML
Server Performance Considerations
CHAPTER 16
Using Server-Side Includes
Introducing SSI
SSI Specification
Configuring SSI
Using SSI in HTML
Sample SSI Programs
Server Performance Considerations
CHAPTER 17
Person-to-Person Interaction
The Next Step with CGI
Introducing HTTP Cookies
CHAPTER 18
Taking Advantage of Web-Based Audio
Introducing Web-Based Audio
Static Audio
Live Audio
RealAudio
ToolVox
TrueSpeech
StreamWorks
Web-Based Telephony
Server Performance Considerations
CHAPTER 19
Using Web-Based Video Cameras
Hardware Requirements
Examples of Web-Based Video Cameras
Movies vs. Still Images
Image Formats: GIF vs. JPEG
Capturing Movies
Windows Implementations
Server Performance Considerations
HTML for Web Cams
Java and Web Cams
Conclusion
CHAPTER 20
Tips and Techniques for Perl
Perl CGI Examples
Perl Security Concerns
Obtaining the Latest Version of Perl 5
Flavors of Perl
Common Perl CGI Libraries
CHAPTER 21
Tips and Techniques for Visual Basic
What You Should Already Know
The Windows Common Gateway Interface
Creating a CGI Application Using VB
Data Access CGI Programming
Security Concerns and Restricting Access to Your CGI Scripts
Obtaining the Latest Version of Visual Basic
Server Performance Issues
Alternatives to Server-Based CGI: Microsoft's VBScript and JavaScript
CHAPTER 22
Tips and Techniques for C/C++
Reading the Input
Parsing the Input
Writing the Output
Putting It All Together
Helpful Libraries
CHAPTER 23
Tips and Techniques for Java
Introduction to Java
The Java Development Environment
Creating Java CGI Applications
Java and JavaScript Applets
Issues and Tradeoffs Related to Java
Links Related to this Chapter 23
CHAPTER 24
Tip and Techniques for AppleScript
Introducing AppleScript
Using AppleScript
AppleScript and CGI
Preparing to Write CGI
Creating Text-Only AppleScript CGI
Creating AppleScript CGI Applications
Other AppleScript CGI issues
CGI Alternatives
Links Related to this Chapter 24
CHAPTER 25
Testing and Debugging CGI Scripts
Create a Lab to Isolate Your Tests
Expecting the Unexpected
Testing Your Script
Documentation of Testing
Debugging Your Script
Testing the Impact of Your Script on the Server
CHAPTER 26
Error Handling in CGI
The Two Sides of Error Handling
Error Detection
Error Reporting
Common Errors to Check
A Philosophy of Error Handling
CHAPTER 27
Understanding CGI Security Issues
Scripts vs. Programs
Trust No One
Inside Attacks
Using Others' CGI Scripts
CHAPTER 28
Learning from the Pros
Programming Tutorials and Sample Code
CGI and SSI Freeware and Shareware
Fun Stuff: Examples of Things Done Right
Indexing
Connecting SQL Databases
Spiders, Worms, Crawlers, and Robots
CGI Interactive Games
A Brief Case Study: Internet Concepts, LLC 18