Online Eiffel Documentation
EiffelStudio

EiffelWeb Sample

This sample shows how to retrieve and display information from a basic form on a web page.

Note: This sample requires a web server supporting CGI in order to be run. Both the Internet Information Services web server from Microsoft and the GNU Apache server may be used.

Compiling

To compile the example:

Installing

You should copy the file web_demo.exe in the cgi_bin directory of your web server and the file sample.html in a directory on the web server.

Running

To run the example, access the page sample.html that you copied on the web server with a web browser (typically http://localhost/sample.html). Fill in the text field with a username and click Submit. You should see a page displaying the name you just entered. Although not earth-shattering, this sample shows the basis for building more complex forms processing in Eiffel.

Under the Hood

This basic sample has just one class SAMPLE which inherits from CGI_INTERFACE. SAMPLE implements execute which retrieves the name entered in the form and creates a new HTML page with it.

See the reference for the class interfaces.