home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 10 / amigaformatcd10.iso / -in_the_mag- / html_tutorial / s00_cgi1.cpp < prev    next >
C/C++ Source or Header  |  1996-09-03  |  623b  |  28 lines

  1. enum bool { false, true };
  2.  
  3. #define NO_MAP
  4.  
  5. #include <iostream.h>
  6. #include <stdlib.h>
  7.  
  8. #include "parse.h"
  9. #include "parse.cpp"
  10.  
  11. void main()
  12. {
  13.   char *query_str = getenv("QUERY_STRING");
  14.  
  15.   Parse list( query_str == 0 ? 
  16.     "tag=one&name=mike&action=%2B10%25&tag=two&log=~mas/log&tag=three" :
  17.     query_str );
  18.  
  19.   cout << "name  = " << list.get_item_n( "name" ) << "\n";
  20.   cout << "action= " << list.get_item_n( "action" ) << "\n";
  21.   cout << "log   = " << list.get_item_n( "log", 1, true ) << "\n";
  22.   for ( int i=1; i<=4; i++ )
  23.   {
  24.     cout << "tag  (" << i << ") = ";
  25.     cout << list.get_item_n( "tag" , i ) << "\n";
  26.   }
  27. }
  28.