CGI scripting with MzScheme

Here is a post on using mzscheme for CGI.

For safe keeping, here is the code:

#!mzscheme -mqf
 
(define *query-string* (getenv "QUERY_STRING"))
 
(define (header type)
  (string-append "Content-type: " type "; charset=iso-8859-1~n~n"))
 
(printf (header "text/html"))
(printf "Hello World~n")
 
(when *query-string*
      (printf "[~a]~n" *query-string*))
 
(exit)
Please follow and like:

Leave a Reply

Your email address will not be published. Required fields are marked *