CSC153, Class 14: CGI Overview: * Short introduction to CGI * Q&A * Lab Notes: * Exam 1 tomorrow * Read "Pairs and Pair Structures" * Sorry that none of you attended the strategic planning meeting * Any questions on strings? ---------------------------------------- CGI Idea: * Rather than just fetching prebuilt pages (and images and ..) from the Web, you might want to run programs to generate those pages: * These programs probably need inputa * Why? + Get information from a database + Get information from a user (to store in a global surveillance system so that we can eliminate terrorism) + We might want to provide students with a program that gives answers to the quadratic formula CGI stands for "Common Gateway Interface" Question: Can you have one Scheme file serve multiple purposes? Reminder: On the Web page (in HTML) that serves as input you write
...
IN Scheme (define page (lambda () (let ((whattodo (get-cgi-variable 'whattodo ""))) (cond ((equal whattodo "alpha") (do-task-1)) ((equal whattodo "beta") (do-task-2)) (else (crash-and-burn-but-nicely)))))) ---------------------------------------- Preliminaries to get this lab to work (1) Open a terminal window (computer screen with foot) (2) Type the following mkdir public_html chmod a+x . chmod a+r public_html chmod a+x public_html There is a period on the second line ---------------------------------------- REFLECTION * Too many 153 students are addicted to a twenty-year old movie * It's very depressing that people whose profession is writing instructions can't. (E.g., why can't CS faculty write clear instructions?)