;;; Look up a course in our database and print it out as an HTML page. ;;; Looks at the CGI envrionment variable 'course to find the course. ;;; ;;; Author: Samuel A. Rebelsky ;;; Version: 1.1 of October 2000 ;;; ;;; History ;;; Monday, 9 October 2000 ;;; Created ;;; Tuesday, 10 October 2000 ;;; Fixed bugs. ;;; Added more courses (implicitly, since courseweb.ss changed) ;;; Added comments. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Libraries (require-library "cgi.ss" "net") (load "courseweb.ss") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Page generation (display "Content-type: text/html") (newline) (newline) (let* ((coursenum (extract-binding/single 'course (get-bindings))) (courseinfo (lookup-course-by-number coursenum all-courses))) (if courseinfo (display (html-document (string-append "Information for " coursenum) (course->html courseinfo))) (display (html-document (string-append "Can't find " coursenum) (html-paragraph "Try again ...")))))