ellyps.net ellyps.net
Using cgi in your scripts

To make use of cgi variables, you need to use (use-modules (www cgi)) in your script

You can see it in action on the example site:
It will print the value of "greet" as given in the url.

http://ponies.ellyps.net/greet.scm?greet=hello
http://ponies.ellyps.net/greet.scm?greet=world

	
  1. #!/usr/bin/guile -s
  2. !#
  3. (use-modules (www cgi))
  4. (cgi:init)
  5. (display "Content-type: text/html")(newline)(newline)
  6. (display "<html><body>")
  7. (display "greeting goes here: <br>")
  8. (display (cgi:value "greet"))
  9. (display "</body></html>")