Chapter 7: Using CGI with ColdFusion
Relative mappings. When application pages are stored in the Web server
document directory, you can use relative URLs to refer to graphics and other
files.
Increased performance. You will not realize the increased performance
provided by the Web server APIs.
Example applications. The example applications installed with ColdFusion will
not work without a server that supports one of the standard APIs.
Referencing Application Pages with CGI
ColdFusion includes a CGI script (
whenever a user submits a form or clicks a link that references it. The CGI script
communicates with the ColdFusion Application Server.
URLs and the cfml.exe script
You are probably familiar with using URLs to refer to documents and images on the
Web (e.g.,
syntax that allows you to call CGI programs and pass them parameters.
To invoke
server along with a
in processing the request.
To pass parameters to the script, you append a "?" to it and then specify a list of
parameters in a 'key=value' format (delimited by the & character).
For example, to call the script and tell it to use an application page file called
myquery.cfm
/ cgi-shl /cfml.exe?template=myquery.cfm
You can call the same application page with an additional parameter
using the syntax:
/ cgi-shl /cfml.exe?template=myquery.cfm&Employee_ID=346
The
cgi-shl
Web server's CGI directory. Your server's CGI path may be different from this (other
common paths are
documentation to determine the appropriate path and (if necessary) use this path
instead of
One good way to verify that your server is able to access
form without input fields that has an ACTION that calls the
arguments (for example,
your server returns an error message that indicates an application page was not
specified. If
indicates it cannot find the script.
http://www.myserver.com/homepage.htm
from a URL, specify the logical path to the executable on your
cfml.exe
parameter indicating which application page file to use
template
, you would use the syntax:
entry italicized in the preceding examples represents the path to your
and
cgi-bin
scripts
.
cgi-shl
ACTION="/cgi-shl/cfml.exe"
is not accessible, your server returns an error message that
cfml.exe
) that is executed by your Web server
cfml.exe
). URLs also support an extended
). You should consult your Web server's
cfml.exe
). If the script is accessible,
271
Employee_ID=346
is to create a simple
script with no
cfml.exe
Need help?
Do you have a question about the COLDFUSION 4.5-ADMINISTRING COLDFUSION SERVER and is the answer not in the manual?
Questions and answers