Calling CGI script from a Web page
You can call CGI script from a Web page located on the HTTP server. In the following example, a push button is added to an HTML file. When the user clicks the push button, the HTTP server executes the CGI script. For information about creating a Web page, see "Creating the home page." In the following HTML file, the new code appears in bold type.
To call CGI script from a Web page
1. Click Application Starter, Utilities, Text Editor.
2. Choose the directory where the home page is saved.
3. Open index.html.
4. Add the new HTML code to the file.
You can refer to the following for a reference.
Note
For information about creating the hello.cgi file, see "Creating CGI script in Corel LINUX."
<html>
<head>
<title>Welcome to the Nature Home Page</title>
</head>
<body bgcolor="#000000">
<p align="center"><font color="#FF0000"><strong><big><big><big>Welcome to the Nature Home Page
<img src="image.jpg" width="575" height="386" alt="image.jpg (59831 bytes)"> </p>
<div align="center"><center>
<table BORDER="0" CELLPADDING="10" CELLSPACING="10" BGCOLOR="lightgrey">
<tr>
<td ALIGN="CENTER"><a HREF="Ocean/index.html">The Ocean page</a></td>
<td AlIGN="CENTER"><a HREF="Islands/index.html">The Islands Page</a></td>
</tr>
</table>
<form ACTION="/cgi-bin/hello.cgi" METHOD="POST" >
<input type="Submit" value="Button" name="B1">
</form>
</center></div>
</body>
</html>
HTML explanation
This example, which was created earlier in the "Creating the Home page" section has new code that creates a push button. You can call the hello.cgi file using the ACTION tag. You must specify the following code: /cgi-bin/hello.cgi. This informs the HTTP server what CGI script to execute. You can define the Method as post. The Form type should be defined as submit. The Value is defined as button. When the user clicks the push button, the CGI program is executed by the HTTP server. This program creates a new HTML page that displays the text "Hello There."