From: David E. <de...@us...> - 2007-09-29 05:30:36
|
John Culleton wrote: > Has anyone used Tiny to generate a cgi-bin program? > If so, what did you use on the html side, get, post, > php, javascript, other? Yes, TC can be used to create a CGI program using basic ACCEPT and DISPLAY statements. One of the ways to do so, would be as follows. * Parse the query string ACCEPT identifier-1 FROM ENVIRONMENT-VARIABLE "QUERY_STRING". ... UNSTRING identifier-1 DELIMITED BY '?' INTO ... ... UNSTRING identifier-2 DELIMITED BY '=' INTO ... ... * If a valid query, find and display data in HTML * format to standard output DISPLAY 'Content-type: text/html' WS-CR WS-LF WS-CR DISPLAY '<!DOCTYPE html PUBLIC ... ' ... DISPLAY '<html><HEAD><title> ...' ... DISPLAY '</body> </HTML>' I have enclosed a sample application for a NA area code lookup, using both a Perl and COBOL programs. Note that the NA area code database file (1) is NOT included, so no area code data is displayed. Hope this helps. 1) Area codes http://www.bennetyee.org/ucsd-pages/area.html |