A-Shell can be launched from a web page to retrieve information from your A-BASIC application and create a new web page using that information. Web programming is an involved topic and exceeds the scope of this guide, but perhaps the following overview of how this can work may help you get started.
The only real requirement of a CGI engine is that it receive the information fed to it by the web page (generally as "standard input" but also possibly as an environment variable), parse it out to determine which variables are being passed and what their values are, and then, after operating on the data, it must create a new web page on its "standard output". Typically, the process is started when the user clicks on a "SUBMIT" button on a page containing some sort of a form that has been filled in. The FORM ACTION tag within the form will reference the name of the CGI command to execute when the SUBMIT button is pressed. So as an example, consider the following simple HTML form:
<HTML>
<HEAD>
<TITLE> Sample Form Using A-Shell as a CGI Engine </TITLE>
</HEAD>
<BODY>
<CENTER>
<H1> Sample HTML Form Using A-Shell as a CGI Engine </H1>
</CENTER>
<P>
<H2> Welcome to our sample form </H2>
This is an example of a typical form that asks some questions, then passes them to a CGI program for some kind of processing, and then displays a new page with the results.
<p>
<FORM ACTION="/cgi-bin/cgitst" METHOD="POST">
<PRE>
Enter your name:<INPUT TYPE="text" NAME="name" SIZE=40>
zip:<INPUT TYPE="text" NAME="zip" SIZE=6>
<HR>
What is your age?
<INPUT TYPE="radio" NAME="age" VALUE="1-10">1-10
<INPUT TYPE="radio" NAME="age" VALUE="11-30">11-30
<INPUT TYPE="radio" NAME="age" VALUE="31-60">31-60
<INPUT TYPE="radio" NAME="age"
VALUE="61-112">61=112
<P>
<TEXTAREA NAME="comments" ROWS=5 COLS=60>
This comment will appear in the comment box, but you can erase it or add to it.
</TEXTAREA>
</PRE>
<HR>
<INPUT TYPE="submit" VALUE="SEND FORM"><BR>
<INPUT TYPE="reset" VALUE="Clear form">
</FORM>
</BODY>
The above HTML displays a simple form that looks like this:
The most important line in the HTML for the purposes of this example is the one starting with "<FORM ACTION". The form of this, and the contents of the referenced script will be slightly different between UNIX and Windows, so they are discussed separately in the following topics.