January 2004
Intermediate to advanced
368 pages
7h 25m
English
A cool use of a shell-based CGI script is to log events by using a wrapper. Suppose that I'd like to have a Yahoo! search box on my web page, but rather than feed the queries directly to Yahoo!, I'd like to log them first, to build up a database of what people seek from my site.
First off, a bit of HTML and CGI: Input boxes on web pages are created inside forms, and forms have user information to be processed by sending that information to a remote program specified in the value of the form's action attribute. The Yahoo! query box on any web page can be reduced to the following:
<form method="get" action="http://search.yahoo.com/bin/search"> Search Yahoo: <input type="text" name="p"> <input type="submit" value="search"> ...
Read now
Unlock full access