In CGI script you may use same functions as for stored procedure.
But at first you have to connect to server by ldbfConnect function.
New fucntons available in CGI script is (see in function.doc):
- ldbfConnect()
- ldbfPort()
- ldbfPuts()  
- ldbfLog()
- ldbfGetHTMLValue()
- ldbfReplaceHTMLValue()
- ldbfGetFieldList()
- ldbfConstruct()
- ldbfRemoveHTMLValue()
- ldbfWhatProgram()
- ldbfServerID()
- ldbfCheckRemote()

In order to setup CGI interface to LDBF you have to do:
 - copy ldbfcgi and(or) ldbfdcgi to /cgi-bin subdirectory
   under httpd's ServerRoot tree.

 - do not forget open access in LDBF server for user, http server runs as.
   If your http server runs as user nobody, allow user nobody from local machine
   connect to server.This must be done in ldbf.conf file.
   access_allow=nobody@host

 - make calls to ldbfcgi(ldbfdcgi) in your html files
   You may call cgi script by two methods,
      ACTION="/cgi-bin/ldbfdcgi?script_name", or
      ACTION="/cgi-bin/ldbfdcgi/script_name"
   In the first case your script must be resided in /cgi-bin/ subdirectory,
   in the second case your script resides in the document directory.

   For example:
     Suppose that your HTTP server's directory is /usr/local/httpd.
     When you call '/cgi-bin/ldbfdcgi?script_name', script must be existed
     in directory /usr/local/httpd/cgi-bin.
     When you call '/cgi-bin/ldbfdcgi/htdocs/ldbf', script must be existed
     in directory /usr/local/httpd/htdocs/ldbf.

 - LDBF server must be properly setup and running

All messages and errors will be written in /tmp/ldbfcgi.log.

LDBFDCGI

ldbfdcgi is a local version of ldbfcgi.It uses shared memory for connecting
to ldbfd.You have to specify server's id by ldbfServerID function
or leave it 0 for default id.In order to ldbfdcgi can connect to LDBF server,
HTTP user must be in the same with LDBF user group and group_allow in
ldbf.conf must be set to 1.

Example how setup ldbfdcgi to run:

  - Suppose that LDBF server runs as user root(0) and group wheel(0)

  - HTTP server may be run as user nobody or any other user,but must be
    run as group wheel(0).Set in httpd.conf:
    User nobody
    Group wheel

  - parameter group_allow in ldbf.conf file must be set to 1
    (group_allow = 1)

  - if your LDBF server runs with default ID (you did not specify -i parameter
    when run ldbfd) you haven't to call ldbfServerID function before ldbfConnect.
    If you run ldbfd with specified parameter -innn,you have to call ldbfServerID
    function before calling ldbfConnect.
    For example:
      you run ldbfd as:  
        ldbfd -i100
      in S-Lang script:
         ldbfServerID(100);
         if(ldbfConnect("localhost") > 0) ...

This program runs faster than ldbfcgi on local machine.

You may use ldbfhtml program for generating HTML pages.
See visit.html and visit.sl for more detail.
