Larry McGoldrick's CPCUG CGI Script Page

Common
Gooseberry
Ingestibles

This page is mainly for CPCUG members with accounts on cpcug.org, and contains information on how to use common gateway interface (cgi) scripts in their web pages. These scripts are the bricks and mortar needed to cause the web server to execute programs (shell scripts, perl scripts, compiled executables and more) on the server and return the results to the client browser that requested them.


Sources and background information

Here are some good links to cgi sources for you to use in your own pages.
  1. Try an OpenText search on "cgi script" and "perl" and "examples" to get you started. When I put this link here (February 1, 1996), the search returned 139 links. Wow.

  2. There is a really good newsgroup devoted to cgi scripts at comp.infosystems.www.authoring.cgi that you should read regularly. There is a faq posted there that you should read before you ask a question that has been asked hundreds of times already. Lurk for a while before posting.

  3. You can also get information on how to set up page counters from this Yahoo search, which is really comprehensive.

  4. Don't know much about perl? Neither do I. Try this hyperlinked perl manual to get you started. I did. There is even a version of perl for DOS available for you to learn perl at home.

  5. There is a really good list of public domain scripts here, with lots more links to other sources. Try them.

  6. ....


Local examples

Here is a collection of scripts that are being run on our local server.
  1. Try the what script. This simple perl script (here's the source code) will return information about our web server, your web browser, and your location. It also contains a primitive (but fast) web page access counter that you can implement locally. I stole the perl code from Paul Shapiro, who probably stole it from somebody else. Doing this will not make you a bad person, but if you grab something from somebody else, please credit them in your source file.
    Here's a simpler script (env.cgi) that reads the environment variables automatically, and here's the source code for the script.

  2. Try the CPCUG Help Page (Here's the source code for the perl script). I have created a web-based help system for cpcug.org users. It contains an index of answers to some frequently asked questions, a link to the cpcug.help newsgroup, and an email form for you to send help requests directly to the User Support Team from a web page. What links would you like to see on this help page? Its utility will depend on user input since I don't know everything.

  3. Try the CPCUG ManPage. With it you can get help on any Unix command without having to telnet to cpcug.org and type man [command] at the prompt. The man page for the command you enter on the manpage form will appear in your web browser when you click the submit button. Each webified man page will also contain hyperlinks to related commands, too. Finally, this is an unusually easy way to print the neatly formatted man page you want directly from your web browser (try that from a telnet session!).
    This is done by a cgi perl script -- man.cgi -- that itself creates a web page (html) containing a form for entering the Unix command and a selection list containing choices for which part of the man system you wish to search (including a fine keyword search through all available man files on the server -- try it).
    The webified man pages are created by a perl script (man2html) that is executed by the man.cgi script. Look at the source code for man2html and man.cgi to see how this is done. The original source code for these two perl programs was created by Earl Hood (ehood@convex.com), and is freeware under the GNU license.

  4. Ever wonder how to make a scrollable jumpto list like this one? Really simple with the jump.cgi script that I wrote. Simply copy these html lines to your own html document, changing the <form ... action = "..."> part to agree with the location of your copy of the jump.cgi script, which you should copy to your own web directory.

  5. Here is a simple web-based messaging system. It operates like a single-conference bulletin board. Give it a try and let me know what you think. This NewsNet page is now a part of our User Support Team tools. Have a look at the perl script for this NewsNet system.
    The script was written by Russ Adams, who generously donated the messagebase management tools to the CPCUG. Many thanks, Russ.

  6. Here is a simple web-based traceroute script that you can use to trace the route taken by IP packets from the cpcug.org server to anywhere you want. Here's the source code for the script.
    Here's a slightly more complicated traceroute with its source code.

  7. Ever want to know who is logged on to cpcug.org and what they are doing? Here is a simple who and what script with its source code that will tell you that.

  8. How about a whois lookup at Internic. Here's the simple source code.

  9. If your browser is capable of interpreting JavaScripts, here's Justin Boyan's search script Hunting the SNARK. Here's the source code. Don't ask me questions about Java or JavaScript, because I'm not there yet....

  10. Looking to set up a feedback form, but don't know where to begin? FormMail allows you to write any form, and as long as a few simple hidden configuration fields are added, the results of the form will be mailed back to you. This script can also be installed and used system wide or by a single user. You can have the form send the results to multiple recipients and specify how you want the information sorted as it comes into your mailbox.
       Scott Mohnkern has set the script up in the cgi-bin directory so all cpcug.org web-account users can call it from their own web pages without needing to copy it to their own web space. He has provided full instructions for creating a form in your own web space that will use this FormMail script  (© 1996, Matt Wright). Visit Matt's site for many more really fine scripts.

  11. How about a random_midi script for a random MIDI file player? Here's the simple source code. It is quite rudimentary, but it gets the job done. I'm open to suggestions for improvement.
       There are some examples of how to embed background sounds near the top of my personal page. There is also a cgi-controlled drop-down selection list of midi files. Hava a look at the page source to see how this is all done.

  12. Web page designers often need to specify colors for the various elements on a web page such as background color and the colors of texts -- body text, link and visited link text, and other selected text. It is often inconvenient to determine the numerical codes that go into such tags as
    <BODY BGCOLOR="#RRGGBB" TEXT="RRGGBB" ... >.
    Netscape and Internet Explorer both support named colors in these tags. To simplify your page-creation task, I have installed an interactive CPCUG JavaScript ColorPicker page. You need a frames-capable and JavaScript-capable browser to view these pages properly.

  13. What else would you like to see here? Mail suggestions to me.

  14. ...




© 1996, Larry McGoldrick
URL -- http://www.cpcug.org/scripts/