#!/bin/sh string=? ; exec /users/staff/math/sbloch/install/usrlocal/bin/mzscheme -r $0 "$@" (require-library "cgi.ss" "net") (require-library "date.ss") (define (html-enclose tag options body) (string-append "<" tag " " options ">" body "")) (define (h1-center string) (html-enclose "h1" "align=\"center\"" string)) ; (define dummy-bindings '((name . "Joe Schmoe") (address . "jschmoe@adelphi.edu"))) (let* ( (current-date (date->string (seconds->date (current-seconds)))) (bindings `((date . ,current-date) ,@(get-bindings))) (name (extract-binding/single 'name bindings)) (label (string-append "Thanks, " name)) ) (with-output-to-file "/usr/users/sbloch/html/class/160/survey.results" (lambda () (write bindings) (newline)) 'append) (generate-html-output label `(,(h1-center label) "Your data have been saved." "

" ; "Current directory: " ,(current-directory) "

" ,@(bindings-as-html bindings)) ) )