How to Process CGI Forms with Euphoria and Xitami

Mike Wever
Mike Wever
  • Published Content: 26
  • Total Views: 12,538
  • Favorited By: 1 CPs
Full Profile | Subscribe | Add to Favorites

Simple, Powerful CGI for Free

Xitami is a simple, yet powerful, free web server from the iMatix corporation. Euphoria is a simple and powerful free programming language created by Rapid Deployment Software. The two of them can work very well together to provide CGI functionality for your web site at no cost.


This tutorial assumes that you have a basic knowledge of the Xitami web server and the Euphoria programming language, as well as a familiarity with CGI programming. If this is not true for you, be warned that some of the following tutorial may be harder to understand. The tutorial is based on a system using Xitami version 2.5c2 and Euphoria version 3.1 on a computer running Windows XP SP2. Your system should use a similar or newer configuration.

Set up the Xitami Server

The first step is to set up Xitami to recognize Euphoria programs. This is done by setting up filters. Go to the web-based Xitami control panel and select the Configuration option. From there, select the Filters page from the navigation links along the top.

Set up one or more new filters using the file extensions that you want to use for Euphoria files. In my example, I have used the default Euphoria extensions of .ex and .exw. The filters must point to the processor program EXWC, which runs as a Windows program in console mode. The other processors (EX and EXW) do not work correctly with Xitami. Make sure you save your configuration after adding the new filters.

While you are in the control panel, check the CGI page to ensure that your CGI options are set correctly. The options "CGI enabled" and "Use standard I/O" must both be checked.

Restart your web server after making these changes. Once the server has started back up, it will be ready to process Euphoria programs.

Write a Euphoria CGI Program

See the sample program I have provided to get an idea of how to work with CGI in Euphoria. This program accepts data sent with the GET method and displays the method and the data on the web page.

The Xitami webserver was named by reversing Imatix, the name of the company that developed it.
 
 
Comments
Type in Your Comments Below

Have more to say?
Become a Content Producer on AC