Skip to content

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)

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*