3 # Demo of CGI 1.1 interface
7 # get form data from CGI STDIN parse and
8 # write back to the client browser
14 (print "Content-type: text/html\r\n\r\n")
15 (println "<h3>Post or Get Variables</h3>\n")
17 (set 'input (read-line))
18 (if (not input) (set 'input (env "QUERY_STRING")))
20 (set 'vars (parse input "&"))
22 (replace "+" elmnt " ")
23 (println elmnt"<br>"))
27 # command line arguments
28 (print "<h3>Command line</h3>\n" (main-args) "<p>\n")
31 # print environment variables
32 (println "<h3>Environment Variables</h3>")
33 (dolist (e (env)) (print e "<br>"))
35 (println "CGI by newLISP v." (sys-info -2))