C++ CGI Variable Wrapper

C++ CGI Information and Variable Wrapper Libraries

 Homepage: Variable Wrapper | HOW-TO do CGI with C | References | PurplePixie Main

CGI C++ Variable Wrapper

This system is a C++ based wrapper to make user input easier from within a CGI application. If you are here then you are developing a CGI application and know about the GET and POST methods of data input.

As it is written in ANSI standard C++ this wrapper can be used with any ANSI-compliant C++ compiler (it has been used with gcc under Linux and Borland BCC/ Builder under Windows). Your compiler must support some basic functions such as getenv(). Assuming that your compiler is ANSI compliant and your webserver uses the CGI 1.1 standard to pass data, all should be well. If you encounter an environment which causes problems with this please contact us.

The wrapper can deal with both methods (or a URL encoded string from the user if you wish to pre-parse user input).

Variables are read into a linked list that can be searched easily using the Fetch method and returns a char* pointer to the value of stated variable.

It really is very simple to use and I find saves quite a bit of work for developing interactive CGI's. Version 2.02 onwards also includes the ability to dump the variable list to stdout in a format suitable for inclusion either in a URL or as hidden input fields for a form. Version 2.03 was a small bugfix for 2.02 and URL encodes the plus (+) sign which was overlooked with the URL dump method.

Version 2.06 introduces some basic Cookie support but there was a bug which was fixed in 2.07.

Documentation is provided with the release and can be viewed online using the menu on the right side of this page. The full release includes some example programs which will be fully documented and examples deployed here at some point (though they should be fairly self-explanitory). For the moment there are two simple examples here if you want to see example output:

http://www.purplepixie.org/cgi-bin/dump.cgi [With Some Data]


USAGE - Usage Guide
COMPILATION - Compiling Into Your Code
REFERENCE - More Detailed Reference
COOKIES - Using Cookies
CHANGES - Very Sparse Change Log
LICENCE - Software Licence Information


cgi_interface.h - Header File (2.07)
cgi_interface.cpp - Source Code (2.07)
wrapper_2.07.tar.gz - All 2.07 Files
Download Previous Versions

Bug Tracking

PurplePixie BugTrack for CGI Wrapper


GCC Tested Ok
BCC 5.5/.6 Tested Ok
Web Servers
Apache (Linux) Tested Ok
Apache (Win32) Tested Ok
Savant (Win32) Tested Ok

© Copyright 2004-2007 purplepixie.org, all rights reserved.