The Linux version of the FORM ACTION command will most likely reference a Linux shell script, using syntax similar to this:
<FORM ACTION="/cgi-bin/cgitst" METHOD="POST">
This causes the command /cgi-bin/cgitst to be executed, using the "POST" method of parameter passing, when the "SUBMIT" or "SEND FORM" button is pressed. Depending on the web server and environment it might be possible to specify some form of A-Shell executable in the FORM ACTION tag, but normally it will be a shell script that in turn launches A-Shell with the appropriate parameters to service the request. In this example, our cgitst shell script contains the following:
#!/bin/bash
exec /vm/miame/bin/ashell -i /vm/miame/miame.ini –cgi –e cgicmd 2>/tmp/cgi.err
The script starts by specifying that it is to run under the bash shell. It makes little or no difference which shell it runs under, since the task is simply to execute an A-Shell command line, but most web servers require this initial line so it knows how to handle launch the script. The actual A-Shell command line must include the -cgi switch, a startup command (cgicmd in this case, i.e. cmd:cgicmd.cmd), and typically redirects the stderr channel to a file. In -cgi mode, regular PRINT statements are redirected to stderr while the response to the web server uses stdout.
Note: in the FastCGI case, the web server would normally be configured to use a different directory for the scripts. such as /fcgi-bin/ instead of /cgi-bin/, and the scripts would need to launch A-Shell with -cgifast instead of -cgi. If you are using both CGI and FastCGI, you might also want to add extensions to the scripts to more easily distinguish them—e.g. script1.cgi vs. script1.fcgi—in which case the extension would need to be included in the FORM ACTION statement, and probably be registered in the web server's configuration file.
See Also
| • | CGI Command Line for more discussion. |