An HTML executable is a standard executable which resides in a directory which is recognized by the corresponding httpd server as containing executables. The set of such directories normally includes /cgi-bin, but most httpd servers can be configured so that other directories are also included in this class. CGI stands for ``Common Gateway Interface'', see this document for a good introduction of CGI scripts and HTML forms.
When access to a standard document is requested by a browser, the httpd server normally simply returns the contents of the file (which is normally in HTML format). However, if the requested address corresponds to a file in an executable directory then the server first runs the executable and then returns to the requesting browser the output produced by such run (which is normally in HTML format or another format which can be handled by the browser). HTML requests to executables are generally information requests and Logic Programming is a natural choice for developing applications capable of fulfilling such requests.
Developing a WWW executable in Prolog simply amounts to producing a Prolog program which, when executed, returns an HTML document. The formatting facilities presented in the previous sections can be used for providing such a document. The Prolog executable can be produced using the usual techniques in Prolog, i.e., through a saved state or by generating a stand-alone executable. At CLIP we have also developed a simple package for creating ``Prolog scripts'', i.e., files containing source code which simply run when executed, in the same way as is usually done, for example, with shell scripts in UNIX (this package will be released soon).
The Prolog HTML package also contains some simple predicates which somewhat simplify the operation of producing a cgi-bin executable:
The following section explains the facilities provided by the package for creating form handlers, including the parsing of input from HTML forms.