fPcgi Program Documentation - SCO Openserver/Unixware version


March 26, 2001 Revision

Installation - Steps to Follow


Setting up SCO environment Variables to handle fPcgi requests


Setting up Apache Web Server to be able to use fPcgi


Starting and Stopping the Apache Web Server

Once you make the necessary changes to the Apache httpd.conf file, you must stop and then re-start the Apache Server.

To stop apache [default locations shown] type in /usr/local/apache/bin/apachtctl stop at a command line prompt and hit the Enter key. To re-start Apache type in /usr/localapache/bin/apachectl start at a command line prompt and hit the Enter key.


Setting the correct Ownership and Permissions for fPcgi to work

The server root directory where fPcgi creates the flat ASCII file filePro processing builds the return html document must have the correct permissions to allow fPcgi/filePro [User filepro Group group] to be able to read and write new files to it. Be sure to set the permissions accordingly.

Also you must be sure that thefpcgi file in /usr/local/apache/cgi-bin have complete read/write/execute permissions.


Making sure there is a user named filepro and a group named group

Since the Apache server is set up to run fPcgi as User filepro with a Group of group , make sure your server has user account called filepro and a Group called group before you try to run the sample application.


Making sure that fpcgi.env is correct

The fpcgi.env which is the the cgi-bin directory of the Apache server [default is /usr/local/apache/cgi-bin] needs to properly reflect the environment settings for both fPcgi and filePro in order for fPcgi to work properly.
Typical fpcgi.env file contents which assumes the the filePro executibles are in /appl/fp and that the filePro data files are in /appl/filepro:


PFDATA=
PFPROG=/appl
PFDIR=/appl
PFSERVROOT=/usr/local/apache/htdocs/
PFMENU=/appl/fp/menus
PFGLOB=/appl/fp/lib/edits
PFSERVER=127.0.0.1
FPCGILOG=/tmp/fpcgi.log
PFADDWP=OFF
PFUFLAG=ON
PFCOUNTERMAX=50
FPCGILOG=/tmp/fpcgi.log

How does filePro fPcgi work?

filePro fPcgi uses proven Internet/Intranet technology to provide you with a visual interface. A browser requests HTML documents from the HTTPd server and then displays HTML pages that are created by user developed filePro processing table(s) The browser then controls the input and updating of data by the user as directed by the HTML code, Javascript functions and Java applets.

The following diagram illustrates the typical flow of requests and data between the browser, HTTPd server, fPcgi, and user developed filepro processing, databases and HTML pages:

Let's now step through the process and explain each piece.


  1. The browser displays the initial HTML document and allows the input or update of information or responds to the user requests.

  2. When the user is finished and has requested an action that requires the browser to get another document, the browser submits a request to the HTTPd server.

  3. Typically, the requested action is for the HTTPd server to execute the fPcgi program. This request is specified in the HTML document using the FORM ACTION command and reserved hidden fields in the HTML document. The fPcgi executible file and its corresponding fpcgi.env, fpcgicmd.txt, and counter files are normally installed in the cgi-bin directory of the web server.

  4. First the fPcgi program reads the counter file and uses its contents along with some hidden fields from the HTML document to construct a unique filename. It then increments the counter by one. It also reads the fpcgicmd.txt file to make sure the command that is about to be run is an authorized command. The command must be on the fpcgicmd.txt list in order for fPcgi to run it. If is is not on the list, fPcgi returns an error document back to the browser and the following steps do not take place.

  5. The fPcgi program then creates a flat ASCII file in either the server root directory or the directory specified by Field_ddir (if present in the document) with all of the field contents, hidden and visible, one record per field. Each record contains the field name and its contents.

  6. Then fPcgi, using the environment specified by the fpcgi.env file if the Field_env is not present in the document, executes the system commands that are specified in the Field_cmd hidden field(s). A typical system command would be, for example, to run Rreport specifying the filePro filename, output format, selection set, output processing table etc. If the Field_norcmd field is not present for the corresponding Field_cmd, fPcgi appends to the system command specified (using the -RW flag) the filename [less the .txt extension] of the flat ASCII file that contains HTML field information. It then executes the requested system command using the environment specified in the file specified by the Field_env variable, if present, or by the fpcgi.env field if Field_env is not present or uses the envirnoment specified in the autoexec.bat or unix profile file if neither Field_env or fpcgi.env exist. .

  7. Rreport executes and determines the correct flat ascii filename it needs to import from using the @PW system variable function. The processing table then imports the field information.

  8. The processing table processes the data, and on the basis of what is supposed to happen next creates an HTML document to be returned to the user. The filename of this HTML document is the same as the flat ACSII file but with an extension of .HTM [default] or an extension specified by Field_extension] in the original HTML document.

  9. When the last Field_cmd system command finishes executing, fPcgi uses several hidden fields to determine where to find the filePro created HTML document that needs to be returned to the browser.

  10. fPcgi then copies the return document to the root server directory or directory specified by Field_cdir if it is present. If Field_ddir is the same as Field_cdir, it knows that it doesn't need to do the copy.
  11. It then requests that the HTTPd server pass back the return HTML document to the browser. If Field_return is present and contains a HTML page address, fPcgi will return that page instead of the page matching the flat ASCII file filename as above.
    For instance, if the HTML document includes
    <INPUT TYPE="Hidden" NAME="Field_return" VALUE="thankyou.htm">
    fPcgi will return thankyou.htm instead of looking for a filepro processing generated HTML document.
  12. The HTTPd server passes the return HTML document back to the browser.

  13. The browser reads and displays the returned document and the process continues...



A more detailed look at the pieces

Browser, HTML and HTTPd server: The browser provides the visual [GUI] interface to the user. It displays HTML documents which may be a combination of static and dynamic documents generated by user developed filepro processing table using the HTML command and JSFILE commands.

One of the most important things the browser does is to submit requests indirectly to fPcgi to retrieve and update database records and other user developed filePro system operations.

The browser actually submits a request to the HTTPd server to in our case, execute fPcgi. This is triggered by a 'submit' function in the HTML document. A typical Form Action line is as follows:


<FORM NAME="myform" TARGET="_parent" ACTION="http://127.0.0.1/cgi-bin/fpcgi" METHOD="POST">
Where the 127.0.0.1 is the HTTPd Server's IP Address.
As we saw in the diagram above the HTTPd server sits between the browser and the fPcgi program. The HTTPd server 'serves' up the HTML documents including any external Javascript files and Java applets needed by the HTML document to execute. It, in turn, 'serves' back to the browser the resulting user developed filePro processing table generated as requested by fPcgi.

In an Intranet or Internet environment, this HTTPd server is normally located on a server independent of the 'client' PC that is being run by the user.

fPcgi with its corresponding counter file and valid command file


This program is executed by a HTTPd server and, in turn, reads the fielded information from the HTML document that requested that it be run. It uses the Field_base contents, and the contents of the counter file to 'construct' a file name for the ASCII file it creates with the field contents from the HTML document. It then checks the fpcgicmd reserved command list to make sure the command is okay to be executed for security reasons. The fpcgicmd.txt file has the following structure:
First Word of System Command as it might appear in Field_Cmd fields:
Example:
rreport
dprodir
fPcgi generated flat ASCII file:

A typical flat ASCII file generated as the result of the request from the HTML document using a Action Method looks like this:
Field_ddir,/usr/local/apache/htdocs/
Field_rn,0
Field_base,xdemo
Field_fn,democgi
Field_cmd,rreport democgi -sr 1 -fp demosave -n
Field2,Lee
Field3,H
Field4,Machan
Field6,fP Technologies, Inc.
Field14,(317) 802-0187
Field15,
Field16,(317) 802-9378
Field17,lmachan@fptech.net
Field18,www,fptech.net
Field1,12345
Field22,This is a sample message
In this case, there are normal user fields being passed. This sample application followed the recommended field naming conventions, so they appear as Field2,Lee etc.
fPcgi command environment:

fPcgi runs the commands specified by the Field_cmd's using an environment specified as follows:
Typical fpcgi.env file contents:
PFDATA=
PFPROG=/appl
PFDIR=/appl
PFSERVROOT=/usr/local/apache/htdocs/
PFMENU=/appl/fp/menus
PFGLOB=/appl/fp/lib/edits
PFSERVER=127.0.0.1
FPCGILOG=/tmp/fpcgi.log
PFADDWP=OFF
PFUFLAG=ON
PFCOUNTERMAX=50
FPCGILOG=/tmp/fpcgi.log

Reserved Hidden fields used by fPcgi and their functionality: [Currently, not all versions support these fields]

Field_baseThis hidden field is used to tell fPcgi the first few characters of the flat ASCII and corresponding return HTML document filename. fPcgi constructs the ASCII filename by taking the Field_base contents, appending the counter file contents and adding the .txt extension. It then passes this filename less the extension to, lets say, rreport using the -RW flag.
Field_cdirThis is the directory location where fPcgi will copy the return document to before it redirects the browser to it. If Field_cdir is set to the same value as Field_ddir, it will not do the copy. The path is relative to the server document root directory. If Field_cdir is not present, fPcgi will copy the return HTML document to the server document root directory if Field_ddir is not equal to the server document root directory.
Field_cmd
Field_cmd1
Field_cmd2
....
Field_cmd9
These fields contain the system command(s), up to 9, that you want the fPcgi program to execute. fPcgi will try to execute in the following order:
Field_cmd
Field_cmd1
Field_cmd2
....
Field_cmd9
Any or all of these hidden fields can be used - fPcgi looks for all of them, and if any of them exists it is executed. If there are errors executing any command then fPcgi exits with an error message. When the last command you have requested has finished being executed, fPcgi will return the HTML document back to the browser unless there is a corresponding Field_norcmd field present.
Field_ddirThis is a fully pathed directory location where you want fPcgi to put the flat ASCII file and where fPcgi expects to find the return HTML document your processing table creates as a result of a Field_cmd command.
If you specify a directory other than the server document root directory, fPcgi will copy the return HTML document to the server document root directory before it re-directs the browser to it, unless Field_cdir is present and it points to a different copy to/re-direct to location. In which case, it copies the return HTML document to the location specified by Field_cdir and re-directs the browser to it there.
Field_envSpecifies the filename of the fPcgi environment file containing environment variables for fPcgi to use instead of the default environment set by autoexec.bat or a UNIX script for the variables set in the specified fpcgi env file. If this variable is not present fPcgi either uses the environment set by the fpcgi.env if it exists or uses the default environment set by either autoexec.bat [Windows] or .profile [UNIX]
Field_extensionSpecifies the extension of return document that fPcgi will redirect back to the browser that was created by filepro processing. If Field_extension is not present in the document it will assume 'htm'
Field_framesSpecifies frame identifier and is passed through the -rw flag as frameid_commandpath
Field_logField_log which should contain the full path to a log file if you want one. This log file is created by fPcgi if it does not exist and is appended to if it does exist. This log file will have written to it - the date and time the program is started, any errors encounted, and exit message.
Field_nonullDo not redirect standard fPcgi output to null when command is run by fPcgi.
Field_norcmd
Field_norcmd1
Field_norcmd2
...
Field_norcmd9
If this hidden field is present and set to anything, fPcgi will not append an -rw flag and the flat ASCII filename at the end of the corresponding system command. Format is Field_norcmdN where N is the corresponding command number. See Field_cmd above. This will allow you to run a batch file or other commands that do not require the -rw flag and flat ASCII filename.
Field_returnIf this hidden field is present and set to anything, fPcgi will not expect a return HTML document based on Field_base and counter. Instead it will return the document specified by this field to the browser.

HTML document field naming conventions

It is reommended that the developer conform to the following field naming conventions.
ConventionUse
Field_cmd, Field_????Used by fPcgi as described above.

Additional ones can be used by your filepro processsing table(s) to pass such things as file names, record numbers , indexes, selection sets etc.
Field1, Field2 ...Recommended that the developer use this convention for real input fields on your forms.

The sample democgi filepro application uses the actual field number in a given file that is being accessed which simplifies the import/update process. See how its used in the demosave processing table.
Dummy???, Dummy??? ...Recommended that the developer use this convention for dummy input fields on your forms.


Sample Form to trigger fPcgi action:

Please Leave a Message for Us
From Your Name:
Company:
Telephone: Ext:
Fax:
Your E-Mail Address:
Your Web Page:
Your Customer Code:
Reference Previous Message #:
[Leave Blank for New]
Message To: Call me?:
Message:


What the HTML Source Code Looks Like for the Form:

When the submit button is clicked, this form will tell the browser to execute fPcgi as specified in the Action value.

fPcgi will examine the fields in the form including the hidden fields and will:

The HTML FORM in this example is for a SCO platform:


<HTML>
<!.. Copyright 2001, fP Technologies,Inc. All Rights Reserved>
<!.. Author Lee Machan>
<!.. Last Revision 3/21/2001 LHM>
<SCRIPT language=javascript>
function getHost()
{  var fphost=location.hostname
     document.myform.action="http://" + fphost + "/cgi-bin/fpcgi"
}
</SCRIPT>
<BODY onload="getHost()">
<FORM name="myform" ACTION="" METHOD="POST"> 
<INPUT TYPE="HIDDEN" NAME="Field_ddir" value="/usr/local/apache/htdocs/"> 
<INPUT TYPE="Hidden" NAME="Field_rn" VALUE="0"> 
<INPUT TYPE="HIDDEN" NAME="Field_base" value="xdemo" > 
<INPUT TYPE="HIDDEN" NAME="Field_fn" value="democgi" > 
<INPUT TYPE="HIDDEN" NAME="Field25" value="N" >
<INPUT type="hidden" name="Field_cmd" value="rreport democgi -sr 1 -fp demosave -n"> 
<INPUT type="hidden" name="Return" value="fpcgidemosco.htm"
<CENTER> 
<table border=0> 
<TR>
<TD><B><I>Please Leave a Message for Us</I></B></TD>
<TD> 
</TABLE> 

<TABLE BORDER="3" bgcolor="#D3D3D3"> 
<TR> 
<TD ALIGN="RIGHT"><I>From Your Name:</FONT> </I></TD>
<TD><INPUT name="Field2" size="16" maxlength="15"></TD> 
<TD><INPUT name="Field3" size="1" maxlength="1"></TD> 
<TD><INPUT name="Field4" size="27" maxlength="25"></TD> 
</TR> 
<TR> 
<TD ALIGN="RIGHT"><I>Company:</FONT> </I></TD>
<TD colspan="3"><INPUT name="Field6" size="40" maxlength="40"></TD> 
</TR> 
<TR>
<TD ALIGN="RIGHT"><I>Telephone: </I></TD> 
<TD><INPUT name="Field14" size="14" maxlength="14"></TD> 
<TD ALIGN="RIGHT"><I>Ext: </I></TD> 
<TD colspan=3><INPUT name="Field15" size="5" maxlength="5"></TD> 
</TR> 
<TR>
<TD ALIGN="RIGHT"><I>Fax: </I></TD> 
<TD colspan=5><INPUT name="Field16" size="14" maxlength="14"></TD> 
</TR> 
<TR> 
<TD ALIGN="RIGHT"><I>Your E-Mail Address: </I></FONT></TD> 
<TD colspan=5><INPUT name="Field17" size="47" maxlength="60"></TD> 
</TR> 
<TR> 
<TD ALIGN="RIGHT"><I>Your Web Page: </I></FONT></TD> 
<TD colspan=5><INPUT name="Field18" size="47" maxlength="60"></TD> 
<TR>
<TD ALIGN="RIGHT"><I>Your Customer Code: </I></TD> 
<TD colspan=5><INPUT name="Field1" size="6" maxlength="6"></TD> 
</TR> 

<TR>
<TD ALIGN="RIGHT"><I>Reference Previous Message #:<BR>[Leave Blank for New]</I></TD> 
<TD colspan=5><INPUT name="Field24" size="6" maxlength="6"></TD> 
</TR> 

<TR>
<TD ALIGN="RIGHT"><I>Message To: </I></TD> 
<TD>
<SELECT SIZE="1" NAME="Field23">
<OPTION VALUE="ANYONE" SELECTED="SELECTED">ANYONE</OPTION>
<OPTION VALUE="DAN BOND">DAN BOND</OPTION>
<OPTION VALUE="LEE MACHAN">LEE MACHAN</OPTION>
<OPTION VALUE="SUE RUBIN">SUE RUBIN</OPTION>
<OPTION VALUE="SALES">SALES</OPTION>
<OPTION VALUE="BRAD WILKIE">BRAD WILLKIE</OPTION>
</SELECT>
</TD>
<TD ALIGN="RIGHT"><I>Call me?: </I></TD> 
<TD colspan=3>
<SELECT SIZE="1" NAME="Field26">
<OPTION VALUE="N" SELECTED="SELECTED">NOT NOW</OPTION>
<OPTION VALUE="Y">YES</OPTION>
</SELECT>
</TD></TR> 
</TABLE> 
 
<TABLE> 
<TR>
<TD valign=top align=right><I>Message:</I></TD> 
<TD><TEXTAREA Name="Field22" rows=3 cols=60 wrap=virtual value=" "></TEXTAREA></TD> 
</TR>
</TABLE> 
<HR>
<CENTER>
<INPUT TYPE="Submit" VALUE="Submit This Message">
<INPUT TYPE="RESET" VALUE="Clear Form">
</CENTER>
<HR>
</FORM>
<CENTER>
<P>You can use your browser to view the HTML source and see how fPcgi is set up to run filePro processing.</P>
<HR>
<IMG SRC="images/pwrfpcgi.gif">
<HR>
<H3>filePro and filePro Plus are registered trademarks
<BR>and fPcgi is a trademark of fP Technologies, Inc.</H3>
<font face="Verdana" size=-2>
Copyright 2001, fP Technologies, Inc. All Rights Reserved
<P><I>These sample HTML documents and filePro processing tables are covered under the terms and conditions of the fP Technologies, Inc. Program License Agreement</I></P>
</CENTER>
rev. 3/21/2001</font>
</BODY>
</HTML>



Sample processing table run by fPcgi in above example
Actual Processing Table on CD-Rom Requires filePro 5.0 to run
[Top]

Mar 23, 2001  08:39           File Name: democgi                   Page   1
                             Processing: demosave

   1 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: declare fp_fieldnumber, fp_contents, fp_os, fp_ret
   2 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: dim flds(999):1
   3 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:                                        ' Canned txt file right now
       Then: fn=@PW;    fn=fn{".txt"
   4 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: fp_os=@OS
   5 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
isdos    If: fp_os co "DOS"
       Then: 
   6 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
isunix   If: fp_os co "UNIX" or fp_os co "LINUX" or fp_os co "SUN"
       Then: 
   7 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
get1     If:                                                 'Import Record
       Then: import ascii imp=(fn) f=255 r=\n
   8 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: not imp
       Then: goto endit
   9 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
arnd     If: 
       Then: aa(1033,*) = imp(1)
  10 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: aa eq " "
       Then: goto get1
  11 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: v(3)=instr(aa,",");
  12 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: ja(20)=mid(aa,"6",v-"6");    w(3)=v+"1"
  13 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: jb(250)=mid(aa,w,"100");
  14 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ja co "_"
       Then: gosub sav@;        goto get1
  15 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: gosub update
  16 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: goto get1
  17 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
update   If: 
       Then: 
  18 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ' store field number into fp_field
       Then: 'msgbox ja
  19 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
isField  If: ja ne "" AND mid(aa,"1","5")="Field"
       Then: flds(ja)=jb ; fp_fieldnumber=ja ; fp_contents=jb
  20 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: isField AND jb="" AND ja="24"
       Then: flds(ja)=rn



Mar 23, 2001  08:39           File Name: democgi                   Page   2
                             Processing: demosave

  21 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
is22     If: isField AND ja="22"
       Then: xt=tohtml(jb)
  22 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: is22
       Then: flds(ja)=xt
  23 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: mid(aa,"1","6") = "Return"
       Then: fp_ret=jb
  24 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ja ne "" AND mid(aa,"1","5")="dummy"
       Then: return
  25 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: not isField
       Then: fp_contents=fp_contents<"<BR>"{aa{"" ; flds(fp_fieldnumber)=fp_cont
             ents
  26 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: 19=@td ; 21=@tm
  27 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: return
  28 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
sav@     If: ja co "_rn"
       Then: rn(8,,g)=jb;   gosub sitonit
  29 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: return
  30 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
sitonit  If: rn eq "0"
       Then: lookup new = democgi r=free  -n
  31 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: sitonit
       Then: rn=new[@rn] ; write new
  32 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: sitonit
       Then: lookup -  r=rn   -e
  33 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: return
  34 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
endit    If: 
       Then: write
  35 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ' Put Create return document here
       Then: 
  36 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ' Stores -rw flag in field 20 For debugging purposes
       Then:  20=@pw
  37 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
bldhtml  If: ' Create return document
       Then: html "1" :CR @pw{".htm" :TI "Return Thank You"
  38 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :BO
  39 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR
  40 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX  "<CENTER><FONT COLOR=RED>Your New Stored Message:</FO
             NT>"

Mar 23, 2001  08:39           File Name: democgi                   Page   3
                             Processing: demosave

  41 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "<BR>[Reference #:"<24<"Record #:"<@rn{"]"
  42 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX 22{"</CENTER>"
  43 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR
  44 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :H2 "Thank you <FONT color=red>"<2<"</FONT> for sending us
              this message" :AL "center"
  45 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR
  46 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "<CENTER>"
  47 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: lh=getenv("PFSERVER"){""
  48 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "<A HREF=\"/"{fp_ret{"\">Return to Main Page</A>"
  49 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR
  50 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "<B><I>This web page was interactively created in HTML
              at "<@tm<" on "<@t4
  51 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "<BR>by filePro processing using the HTML Command</I><
             /B>"
  52 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "</CENTER>"
  53 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR
  54 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :H4 "Database software provided by fP Technologies, Inc. h
             ome of filePro®" :AL "center"
  55 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :CL
  56 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: end

Record Retrieval Example - Typical Request Form [Top]

Retrieve any Messages You Saved?
Search Value?


What the HTML Source Code Looks Like for this retrieval form:

<HTML>
<!.. Copyright 2001, fP Technologies,Inc. All Rights Reserved>
<!.. Author Lee Machan>
<!.. Last Revision 3/21/2001 LHM>
<SCRIPT language=javascript>
function getHost()
{  var fphost=location.hostname
     document.myform.action="http://" + fphost + "/cgi-bin/fpcgi"
}
</SCRIPT>
<BODY onload="getHost()">
<FORM name="myform" ACTION="" METHOD="POST"> 
<INPUT TYPE="HIDDEN" NAME="Field_ddir" value="/usr/local/apache/htdocs/"> 
<INPUT TYPE="Hidden" NAME="Field_rn" VALUE="1"> 
<INPUT TYPE="HIDDEN" NAME="Field_base" value="xdemo" > 
<INPUT TYPE="HIDDEN" NAME="Field_fn" value="democgi" > 
<INPUT type="hidden" name="Field_cmd" value="rreport democgi -sr 1 -fp demofind -n"> 
<INPUT type="hidden" name="Return" value="fpcgidemosco.htm"
<CENTER> 
<table border=0> 
<TR>
<TD><B><I>Retrieve any Messages You Saved?</I></B></TD>
<TR>
</TABLE> 
<TABLE BORDER="3" bgcolor="#D3D3D3"> 
<TR>
<TD ALIGN="RIGHT"><I>Search Value?</I></TD> 
<TD colspan=5><INPUT name="UsingThis" size="40" maxlength="40" ></TD> 
</TR> 
<TR>
<TD>
<SELECT SIZE="1" NAME="Field_newonly">
<OPTION VALUE="Y" SELECTED="SELECTED">Show New Messages Only</OPTION>
<OPTION VALUE="N">Show New and Read</OPTION>
</SELECT>
</TD>
<TD colspan=5>
<SELECT SIZE="1" NAME="Field_findby">
<OPTION VALUE="indexA" SELECTED="SELECTED">Find by Your Customer Code</OPTION>
<OPTION VALUE="indexB">Find by From Last Name</OPTION>
<OPTION VALUE="indexC">Find by From Company Name</OPTION>
<OPTION VALUE="indexD">Find by From E-mail Address</OPTION>
<OPTION VALUE="indexE">Find by Message To Name</OPTION>
<OPTION VALUE="indexF">Find by Message Reference #</OPTION>
</SELECT>
</TD>
</TR>
</TABLE> 
<HR>
<INPUT TYPE="Submit" VALUE="Retrieve Messages">
<INPUT TYPE="RESET" VALUE="Clear Form">
</CENTER>
<HR>
</FORM>
<BLOCKQUOTE>
<OL>
<LI>Enter the value of the item you want to search for.
<LI>Using the drop down list, select whether you want to view New only or New and Read.
<LI>Using the second drop down box, select the search criteria.
<LI>Click on the Retrieve Messages button.
</OL>
</BLOCKQUOTE>
<CENTER>
<P>You can use your browser to view the HTML source and see how fPcgi is set up to run filePro processing.</P>
<HR>
<IMG SRC="images/pwrfpcgi.gif">
<HR>
<H3>filePro and filePro Plus are registered trademarks
<BR>and fPcgi is a trademark of fP Technologies, Inc.</H3>
<font face="Verdana" size=-2>
Copyright 2001, fP Technologies, Inc. All Rights Reserved
<P><I>These sample HTML documents and filePro processing tables are covered under the terms and conditions of the fP Technologies, Inc. Program License Agreement</I></P>
</CENTER>
rev. 3/21/2001</font>
</BODY>
</HTML>

Sample processing table run by fPcgi to retrieve messages from multiple democgi database records
Actual Processing Table on CD-Rom Requires filePro 5.0 to run
[Top]

Mar 23, 2001  08:39           File Name: democgi                   Page   1
                             Processing: demofind

   1 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ' Copyright 2000, fP Technologies, Inc. All rights reserved
       Then: declare fp_copyright, fp_ret
   2 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: fp_copyright="Copyright 2000, fP Technologies, Inc. All rights rese
             rved"
   3 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ' DEMOFIND  example of processing that accepts a customer # and ret
             urns an HTML document with list of messages
       Then: 
   4 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: declare fp_fieldnumber, fp_contents, fp_os ,fp_newonly
   5 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ' default = show New and Read Messages
       Then: fp_newonly="N"
   6 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: fp_os = @os
   7 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
isdos    If: fp_os co "DOS"
       Then: 
   8 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
isunix   If: fp_os co "UNIX"  OR fp_os co "LINUX"
       Then: 
   9 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: dim flds(999):1
  10 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If:                                        ' Canned txt file right now
       Then: fn=@PW;    fn=fn{".txt"
  11 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: gosub htmlbld
  12 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
get1     If:                                                 'Import Record
       Then: import ascii imp=(fn) f=255 r=\n
  13 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: not imp
       Then: goto done
  14 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
arnd     If: 
       Then: aa(1033,*) = imp(1)
  15 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: aa eq " "
       Then: goto get1
  16 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: '                      PARSE Input line uses first comma found
       Then: v(3)=instr(aa,",");
  17 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: ja(20)=mid(aa,"6",v-"6");    w(3)=v+"1"
  18 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: jb(250)=mid(aa,w,"100");
  19 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ja co "_"
       Then: gosub setidx;      goto get1




Mar 23, 2001  08:39           File Name: democgi                   Page   2
                             Processing: demofind

  20 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: mid(aa,"1","6") = "Return"
       Then: fp_ret=jb ; goto get1
  21 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: aa = "UsingThis"
       Then: gosub findit   ; goto get1
  22 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: goto get1
  23 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
findit   If: 
       Then: io=mid(jb,"1","40")
  24 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: return
  25 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
setidx   If: ja co "_fn"               ' PUT Field_fn as first Hidden Field
       Then: o(32,,g)=jb
  26 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ja co "_newonly"           ' Set Show New Only Flag
       Then: fp_newonly=jb
  27 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ja co "_findby"           ' PUT Field_findby at end of hidden field
             s
       Then: ts=jb          ; goto  indrtn
  28 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: return
  29 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
indrtn   If:                        ' INDEXA...B...C is stored in ts at this poi
             nt
       Then: tt=mid(ts,"6","1")
  30 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt eq "A"
       Then: goto  indxa
  31 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt eq "B"
       Then: goto  indxb
  32 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt eq "C"
       Then: goto  indxc
  33 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt eq "D"
       Then: goto  indxd
  34 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt eq "E"
       Then: goto  indxe
  35 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt eq "F"
       Then: goto  indxf
  36 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: not ind
       Then: goto norecs
  37 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: n=ind[@rn]
  38 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: lookup -  r=n    -np




Mar 23, 2001  08:39           File Name: democgi                   Page   3
                             Processing: demofind

  39 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: return
  40 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
indxa    If: 
       Then: fb=io{""
  41 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: fb=""
       Then: goto norecs
  42 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: lookup ind = (o) k=io i=A -npx
  43 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
noa      If: not ind       ' first time
       Then: goto norecs
  44 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
againa   If: not ind
       Then: goto done
  45 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[1]= io
       Then: gosub htmlmsg
  46 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[1] ne io
       Then: goto done
  47 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: getnext ind
  48 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: goto againa
  49 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
indxb    If: 
       Then: fb=io{""
  50 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: fb=""
       Then: goto norecs
  51 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: lookup ind = (o) k=io   i=B   -npx
  52 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
nob      If: not ind       ' first time
       Then: goto  norecs
  53 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
againb   If: not ind
       Then: goto done
  54 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[4] ne io
       Then: goto done
  55 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[4]= io
       Then: gosub htmlmsg
  56 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: getnext ind
  57 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: goto againb
  58 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
indxc    If: 
       Then: fb=io{""



Mar 23, 2001  08:39           File Name: democgi                   Page   4
                             Processing: demofind

  59 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: fb=""
       Then: goto norecs
  60 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: lookup ind = (o) k=io   i=C   -npx
  61 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
noc      If: not ind       ' first time
       Then: goto  norecs
  62 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
againc   If: not ind
       Then: goto done
  63 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[6]= io
       Then: gosub htmlmsg
  64 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[6] ne io
       Then: goto done
  65 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: getnext ind
  66 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: goto againc
  67 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
indxd    If: 
       Then: fb=io{""
  68 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: fb=""
       Then: goto norecs
  69 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: lookup ind = (o) k=io   i=D   -npx
  70 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
nod      If: not ind       ' first time
       Then: goto  norecs
  71 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
againd   If: not ind
       Then: goto done
  72 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[17]= io
       Then: gosub htmlmsg
  73 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[17] ne io
       Then: goto done
  74 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: getnext ind
  75 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: goto againd
  76 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
indxe    If: 
       Then: fb=io{""
  77 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: fb=""
       Then: goto norecs
  78 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: lookup ind = (o) k=io   i=E   -npx



Mar 23, 2001  08:39           File Name: democgi                   Page   5
                             Processing: demofind

  79 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
noe      If: not ind       ' first time
       Then: goto  norecs
  80 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
againe   If: not ind
       Then: goto done
  81 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[23]= io       ' FLAG MESSAGE AS READ
       Then: gosub htmlmsg ; ind[25]="Y"
  82 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[23] ne io
       Then: goto done
  83 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: getnext ind
  84 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: goto againe
  85 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
indxf    If: 
       Then: fb=io{""
  86 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: fb=""
       Then: goto norecs
  87 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: lookup ind = (o) k=io   i=F   -npx
  88 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
nof      If: not ind       ' first time
       Then: goto  norecs
  89 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
againf   If: not ind
       Then: goto done
  90 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[24]= io
       Then: gosub htmlmsg
  91 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[24] ne io
       Then: goto done
  92 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: getnext ind
  93 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: goto againf
  94 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
HTMLBLD  If: ' Create return document using fpcgi provided -rw flag value
       Then: html "1" :CR @pw{".htm" :TI "Return Thank You"
  95 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :BO
  96 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR
  97 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :CE
  98 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :FN :CO "#FF0000"



Mar 23, 2001  08:39           File Name: democgi                   Page   6
                             Processing: demofind

  99 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX  "Your Stored Message(s):"
 100 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX  "<BR>Unread Messages are shown in red..."
 101 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :FN-
 102 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TA :BO "2"
 103 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TR
 104 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH :AL "Center"
 105 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX "Message to"
 106 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH-
 107 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH :AL "Center"
 108 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX "From"
 109 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH-
 110 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH :AL "Center"
 111 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX "Date"
 112 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH-
 113 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH :AL "Center"
 114 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX "Time"
 115 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH-
 116 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH :AL "Center"
 117 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX "Ref #:"
 118 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH-



Mar 23, 2001  08:39           File Name: democgi                   Page   7
                             Processing: demofind

 119 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH :AL "Center"
 120 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX "Message"
 121 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH-
 122 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH :AL "Center"
 123 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX "Call Them?"
 124 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TH-
 125 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TR-
 126 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: RETURN
 127 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
HTMLMSG  If: ' format each message into table row here
       Then: 
 128 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: fp_newonly ="Y" AND ind[25]="Y"    ' If Show only New = "Y" and mes
             sage is already read.
       Then: return
 129 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TR
 130 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD :AL "left" :VL "Top"
 131 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX  ind[23]
 132 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD-
 133 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD :AL "left" :VL "Top"
 134 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX  ind[2]<ind[3]<ind[4]
 135 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD-
 136 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD :AL "left" :VL "Top"
 137 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX  ind[19]
 138 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD-


Mar 23, 2001  08:39           File Name: democgi                   Page   8
                             Processing: demofind

 139 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD :AL "center" :VL "Top"
 140 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX ind[21]
 141 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD-
 142 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD :AL "left" :VL "Top"
 143 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX (ind[24])
 144 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD-
 145 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD :AL "left" :VL "Top"
 146 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[25]="N"
       Then: HTML "1" :FN :CO "red"
 147 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX ind[22]
 148 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[25]="N"
       Then: HTML "1" :FN-
 149 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD-
 150 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD :AL "center" :VL "Top"
 151 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[26]="Y"
       Then: HTML "1" :FN :CO "red"
 152 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX ind[26]
 153 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: ind[26]="Y"
       Then: HTML "1" :FN-
 154 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TD-
 155 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TR-
 156 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: return
 157 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
NORECS   If: 
       Then: 
 158 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :FN :CO "#FF0000"



Mar 23, 2001  08:39           File Name: democgi                   Page   9
                             Processing: demofind

 159 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1"  :TX "No messages were found as specified below"
 160 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :FN-
 161 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
done     If: 
       Then: HTML "1" :HR
 162 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
HTMLEND  If: 
       Then: html "1" :TA-
 163 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: fb=""
       Then: io="No value specified"
 164 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt="A"
       Then: HTML "1" :TX "Select Criteria... By FROM Customer Code:<FONT COLOR=
             #FF0000>"<io<"</FONT>"
 165 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt="B"
       Then: HTML "1" :TX "Select Criteria... By FROM Last Name:<FONT COLOR=#FF0
             000>"<io<"</FONT>"
 166 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt="C"
       Then: HTML "1" :TX "Select Criteria... By FROM Company Name:<FONT COLOR=#
             FF0000>"<io<"</FONT>"
 167 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt="D"
       Then: HTML "1" :TX "Select Criteria... By FROM E-mail Address:<FONT COLOR
             =#FF0000>"<io<"</FONT>"
 168 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt="E"
       Then: HTML "1" :TX "Select Criteria... By Message TO Name:<FONT COLOR=#FF
             0000>"<io<"</FONT>"
 169 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: tt="F"
       Then: HTML "1" :TX "Select Criteria... By Message Reference #:<FONT COLOR
             =#FF0000>"<io<"</FONT>"
 170 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :TX "<BR>"
 171 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "<A HREF=\"/"{fp_ret{"\">Return to Main Page</A>"
 172 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR
 173 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "<B><I>This web page was interactively created in HTML
              at "<@tm<" on "<@t4
 174 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :TX "<BR>by filePro processing using the HTML Command</I><
             /B>"
 175 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR

Mar 23, 2001  08:39           File Name: democgi                   Page  10
                             Processing: demofind

 176 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :IM :SR "/images/pwrfpcgi.gif"
 177 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: HTML "1" :CE-
 178 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :HR
 179 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :H4 "Database software provided by fP Technologies, Inc. h
             ome of filePro®" :AL "center"
 180 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: html "1" :CL
 181 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
         If: 
       Then: end

Troubleshooting fPcgi

The four most common reasons that fPcgi applications do not work are:

  1. The environment settings in the .profile and the fpcgi.env files are incorrect and do not reflect the proper locations of the filePro executibles and filepro application files.
  2. The httpd.conf file does not reflect the correct CGI-BIN directory and execute previledges and the correct filepro executibles location and execute previledges.
  3. The HTML form document has errors such as missing required fPcgi hidden fields, incorrect values for these hidden fields, or an incorrect action line that is failing to execute fPcgi in the first place.
  4. There is an error or halt in the execution of the filepro processing tables that fPcgi is running.

If the sample demo application does not run properly [usually indicated as a lack of a return document after you hit the submit function], check items 1 and 2:

If the sample demo does run but your application does NOT, there is probably an error in your processing table or HTML document.

A quick way to analyze what is going wrong is to determine what the flat ascii filename fPcgi just ran [look in the htdocs directory for the most recent .txt file]. Then when in the htdocs directory, from a command line prompt, run the command that fPcgi was supposed to run and add the appropriate -rw flag to the end of it.

If you still have trouble, the key files to re-examine for correct settings are fpcgi.env, httpd.conf, the profile files, the fpcgi.log [found in /tmp] and ownership/permissions.


fP Technologies, Inc.
5744 W. 79th Street
Indianapolis, IN 46278
Sales: 800.847.4740
Int'l Sales: 212.644.9781
Sales Fax: 212.644.9745
Support 317.802.0138

filePro, filePro Plus and are registered trademarks of fP Technologies, Inc.
fPcgi is a trademark of fP Technologies, Inc.


Document Revision Dated Monday, March 26, 2001
Copyright 2000 - 2001, fpTechnologies, Inc. All rights reserved

These sample HTML documents and filePro processing tables are covered under the terms and conditions of the fP Technologies, Inc. Program License Agreement


Specifications subject to change without notice