#!/usr/bin/perl #========================================================================= # CSEE Course Database Processor # # File: courses.cgi # Author(s): Hank Burton (WHB), Literati Information Technology # # This script reads the CSEE courses database file created by the # DB_Manager application and processes the database for either the # syllabus or current course WWW page. If a WWW page is found for # the course, that site is displayed. Otherwise, the user is # informed that no page exists. # # Paramters: # course : CSEE course number (CS156, EE151, CPE112) # want : requested itemf or course -- 'syllabus' or 'current' # # 05-06-98 (WHB) : created #========================================================================= $|=1; require("../cgi-bin/cgi-lib.pl") || die "require cgi-lib.pl died"; require("../cgi-bin/csee-lib.pl") || die "require csee-lib.pl died"; require("../cgi-bin/ls-lib.pl") || die "require ls-lib.pl died"; &CheckCGIExecute; &ReadParse(*in); # # Process CGI Parameters ------------------------------------------------- # $course = $in{'course'}; $course_want = $in{'want'}; # # verify CGI paramters # # * 'course' & 'course_want' are required # * 'course_want' must have the value 'syllabus' or 'current' # if ( "$course" eq "" or "$course_want" eq "" ) { &litBeginHTMLOutput; print "
"; &DisplayFile("../common/header.html"); print <Parameters course and want are both required!
EOT &DisplayFile("../common/footer.html"); exit 1; } elsif ( "$course_want" ne "syllabus" and "$course_want" ne "current" ) { &litBeginHTMLOutput; &DisplayFile("../common/header.html"); print <Parameter want has an invalid value! It must be either syllabus or current
EOT &DisplayFile("../common/footer.html"); exit 1; } # # Read and Search the Courses Database ----------------------------------- # open COURSES, "../DB_Manager/Data_files/courses.data"; $isMatch = 0; COURSES: while (