From csus.edu!netcom.com!boutell Tue May  9 14:56:46 1995
Newsgroups: comp.infosystems.www.authoring.cgi
Path: csus.edu!netcom.com!boutell
From: boutell@netcom.com (Thomas Boutell)
Subject: comp.infosystems.www.authoring.cgi Frequently Asked Questions (FAQ)
Message-ID: <authoring.cgi.2@nntp.netcom.com>
Keywords: FAQ
Supersedes: <authoring.cgi.1@nntp.netcom.com>
Organization: Nerdsholm
Date: Tue, 9 May 1995 16:16:41 GMT
Lines: 161
Sender: boutell@netcom15.netcom.com

Introduction

There are several World Wide Web newsgroups, and each of the groups
has its own Frequently Asked Questions posting (except for
comp.infosystems.www.advocacy). A set of answers to introductory
web questions can be found in the newsgroup comp.infosystems.www.misc;
consult the Frequently Asked Questions posting of that group first.

A complete hypertext version of the FAQ can be found on the
World Wide Web at <URL:http://sunsite.unc.edu/boutell/faq/index.html>.
If you can, consult the hypertext version; it's much more convenient!

- Tom Boutell, maintainer, WWW Frequently Asked Questions


            HOW DO I GENERATE WEB PAGES FROM A PROGRAM OR DATABASE?
                                       
   Most web servers support one variation or another of a standard for
   adding your own programs to the web server. The standard is called CGI
   (Common Gateway Interface).
   
   Marc Hedlund has written a FAQ on CGI programming (URL is:
   http://www.halcyon.com/hedlund/cgi-faq/ ) which makes a good
   introduction to the subject. The standard itself can be found at NCSA
   (URL is: http://hoohoo.ncsa.uiuc.edu/ ).

              HOW CAN USERS SEND ME EMAIL THROUGH THEIR BROWSERS?
                                       
   There are two ways:
   
   Using a mailto: URL
          You can simply create a link which looks like this:
          
          <A HREF="mailto:me@my.address">Send Me Mail</A>
          
          This works great for browsers that support the mailto: URL.
          Perhaps 80% of web users will be able to use such a link. But
          not all browsers support it.
          
   Installing an email form
          If you have access to the server's configuration files, or if
          your server administrator permits users to create their own CGI
          scripts, you can create a form which sends mail to you from any
          browser that supports forms. A really flexible package for this
          is the mit-dcns-cgi package (URL is
          <URL:http://web.mit.edu/wwwdev/www/dist/mit-dcns-cgi.html> ).
          I've written a simple email forms package (URL is
          <URL:http://siva.cshl.org/email/index.html> ), which does it in
          ANSI C. There is also a package written in Perl, known as the
          WWW Mailto Gateway (URL is
          <URL:http://www.mps.ohio-state.edu/mailto/mailto_info.html> ).
          GetComments (URL is
          <URL:http://everest.cs.ucdavis.edu/~hoagland/getcomments.html>)
          is a more general package, also written in Perl, which can do
          many different things in response to a form submission.
          
          If you want to learn how these forms actually work, see the
          entry on CGI scripts.
          
   

                WHERE CAN I LEARN HOW TO CREATE FILL-OUT FORMS?
                                       
   Writing an HTML form is easy, but the form doesn't accomplish anything
   until you write a CGI program to interpret the results on the server
   side! For more information, see the section on CGI scripts.
   
   See the section on email forms for a simple solution to the most
   commonly desired form.

            HOW CAN I GENERATE GIFS ON THE FLY FROM MY CGI SCRIPTS?
                                       
   If you want to generate GIF images on the fly as part of your
   application, examine the gd library (URL is:
   http://siva.cshl.org/gd/gd.html ). Hint: your HTML page and your
   inline images are separate documents with separate URLs. Generate them
   in response to separate requests! (Yes, there are tricks to speed this
   up, but be careful not to break inline images on HTML pages you didn't
   write that refer to your gd-generated image.)
   
   It's also possible to use gnuplot and the pbmplus utilities. This is
   slower, but can require less programming if gnuplot is sufficient for
   your purposes. (See archie for both tools.)

           HOW CAN I CREATE HIDDEN FIELDS IN FORMS (KEEPING STATE)?
                                       
   Use INPUT TYPE=hidden. An example:

<INPUT TYPE=hidden NAME=state VALUE="hidden info to be returned with form">

   By now, most browsers can handle the hidden type, but understand that
   some browsers will fail to hide the field (and probably confuse the
   user). Note that "hidden" doesn't mean "secret"; the user can always
   click on "view source".

             HOW DO I MAKE A "LINK" THAT DOESN'T LOAD A NEW PAGE?
                                       
   
   
   Such links are useful when a form is intended to perform some action
   on the server machine without sending new information to the client,
   or when a user has clicked in an undefined area in an image map; these
   are just two possibilities.
   
   Rob McCool of NCSA provided the following wisdom on the subject:

Yechezkal-Shimon Gutfreund (sg04@gte.com) wrote:
: Ok, here is another bizzare request from me:

: I am currently running scripts which I "DO NOT" want to return
: any visible result. That is, not text/plain, not text/HTML, not
: image/gif. The entire results are the side effects of the
: script and nothing should be returned to the viewer.

: It would be nice to have an internally supported null viewer
: so that I could do this, more "cleanly" (ok, ok, I hear your groans).

   
   
   HTTP now supports a response code of 204, which is no operation. Some
   browsers such as Mosaic/X 2.* support it. To use it, make your script
   a nph script and output an HTTP/1.0 204 header. Something like:
   
   HTTP/1.0 204 No response Server: Myscript/NCSA httpd 1.1
   
   (You can learn more about nph scripts from the NCSA server
   documentation at the URL http://hoohoo.ncsa.uiuc.edu/docs.)
   Essentially they are scripts that handle their own HTTP response
   codes.

                   HOW CAN I MIRROR PART OF ANOTHER SERVER?
                                       
   Scripts are available to do this, but at this time they are not very
   friendly to the server you are attempting to mirror; their behavior
   resembles that of the more poorly written WWW robots. If you are
   trying to improve access times to a distant server, you will likely
   find the "proxy" capabilities of CERN's WWW server to be a more
   effective and general solution to your problem.

                   HOW COME MAILTO: URLS DON'T ALWAYS WORK?
                                       
   The mailto: URL is a feature found in Lynx, Netscape, Spry Mosaic, the
   latest NCSA Mosaics, Emacs w3 mode and many other browsers. In
   general, about 80% of web browsers support mailto: at the time of this
   writing. However, it is not in numerous older browsers. In the
   meantime, you can set up forms which send mail to you; see the entry
   regarding email forms.

                                    CREDITS
                                       
   
   
   Maintainer (11/93 to present): Thomas Boutell, boutell@netcom.com
   
   Former Maintainer (until 11/93): Nathan Torkington,
   Nathan.Torkington@vuw.ac.nz
-- 
The ouzo of human kindness.
<URL:http://sunsite.unc.edu/boutell/index.html>

Come listen to RealAudio: <URL:http://www.realaudio.com/>

