Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

Cgi Class Reference

#include <cxxtools/cgi.h>

Inheritance diagram for Cgi:

QueryParams List of all members.

Public Member Functions

 Cgi ()
 constructor reads parameters from server

Static Public Member Functions

static std::string header ()
static std::string header (const std::string &type)

Detailed Description

Class for easy extraction of CGI-parameters.

This class reads automatically GET- and POST-parameters from stdin and the environvariable QUERY_STRING, like CGI-programs do. This eases writing CGI-programs in C++.

example:

   int main()
   {
     cxxtools::Cgi q;  // this parses all input-parameters
     std::cout << q.header
               << "<html>\n"
               << "<body>\n"
               << "<form>\n"
               << "<input type=\"text\" name=\"v\"><br>\n"
               << "<input type=\"submit\"><br>\n"
               << "<hr>\n"
               << "</form>\n"
               << "you entered: <b>" << q["v"] << "</b>\n"
               << "</body>"
               << "</html>";
   }

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6