CGI_NEW.INC (c)2001-2003 Chris Warrington rapidq.basic.c45207@spamgourmet.com Version: 1.5 Date: 25-SEPT-2003 ====== Notes ] ====== 1) Please turn "Word Wrap" or a similar function on in your text editor. 2) Please use a fixed width font when viewing this file. ======== License ] ======== This library is free software. You may use according to the following conditions: 1) USE of this library is free. You may use this library however you wish, whether it is for your own private use or for commercial use or anything else. 2) If you make any modifications to this library, you MUST release those modifications to the RapidQ community. 3) Although you may use this library, it is still copyrighted 2003 Chris Warrington. ======= Update ] ======= 1.5: More performance improvements. The query string is only read once. Hex and space replacements are optional. 1.4: Performance improvements. Now replaces ALL "printable" %xx (between " " and "~"). Space replacement is more intelligent. "C+++Help" is turned into "C++ Help" NOT "C Help" 1.3: Removed the LGPL because it was too restricting on use due to the way RapidQ compiles. 1.2: There is more error checking. A maximum input value has been specified and can be defined. There is the option to turn off automatic conversions of +, %24, %25, and %3D into their respective characters. 1.1: I was able to figure out how to get POST to work! ==== Use ] ==== The use of this is exactly like CGI.INC, except the functions SendFooter(), SendB(), and SendHeader() have been omitted. You need to provide these yourself. If you are not familiar with the use of CGI.INC, read on: First, you need to include the file cgi_new.inc in your program. EX: : $INCLUDE "cgi_new.inc" Then, you can use any of the following the variables: CGI_Accept CGI_AuthType CGI_ContentLength * CGI_ContentType CGI_Cookie CGI_GatewayInterface CGI_PathInfo CGI_PathTranslated CGI_QueryString CGI_Referer CGI_RemoteAddr CGI_RemoteHost CGI_RemoteIdent CGI_RemoteUser CGI_RequestMethod CGI_ScriptName CGI_ServerSoftware CGI_ServerName CGI_ServerPort CGI_ServerProtocol CGI_UserAgent * CGI_ContentLength is the only number (It is an integer). The rest are strings. The CGI_QueryString can be parsed for you. To use this function, first you must call InitCgi(). EXAMPLE: : CALL InitCgi() Then you can call GetCgiValue() with an id and get the value of that id. EXAMPLE: : var$ = GetCgiValue("your id here") Pulling it all together, the following sample program can be made: : 'Begin Rapid-Q code. : $APPTYPE CGI : $INCLUDE "cgi_new.inc" : $ESCAPECHARS ON : DIM name$ AS STRING : CALL InitCgi() : name$ = GetCgiValue("name") : PRINT "Content-type: test/html\n\n" : PRINT "" : PRINT "
" : PRINT "