#!/usr/local/bin/perl $term = '20001'; $current_sem = '20003'; $testdir = 'c:/www/siteman/client/nyucfp/website/cfp20001'; $livedir = '/usr/local/ns-home/cfpweb'; $basehref = "http://$ENV{SERVER_NAME}$ENV{SCRIPT_NAME}"; $basehref =~ s/cgi\-bin\/[\x00-\xff]+//; $basehref =~ s/[\/]+$/\//; @allCookies = split(/; /,$ENV{'HTTP_COOKIE'}); foreach $pair (@allCookies) { ($name, $value) = split(/=/, $pair); $cookies{$name} = $value; } ($cmd,@param) = split(/\,/,$ENV{QUERY_STRING}); $out = "COURSE SELECTIONS
\n"; $out .= " "; if ($param[0] eq 'delete') { $setcookies = "Set-Cookie: $param[1]=-999; domain=siteman.npil.com; path=/;\n"; $setcookies .= "Set-Cookie: $param[1]=-999; domain=www.scps.nyu.edu; path=/;\n"; print "content-type: text/html $setcookies
"; exit; } elsif ($param[0] eq 'removeall') { foreach $key (keys(%cookies)) { if (($key =~ /[XR]/) && ($cookies{$key} != -999)) { $setcookies .= "Set-Cookie: $key=-999; domain=siteman.npil.com; path=/;\n"; $setcookies .= "Set-Cookie: $$key=-999; domain=www.scps.nyu.edu; path=/;\n"; } } print "content-type: text/html $setcookies "; exit; } $numcourses = 0; foreach $key (keys(%cookies)) { if (($key =~ /[XR]/) && ($cookies{$key} != -999)) { $numcourses++; $temp_section = $cookies{$key}; $temp_section =~ s/\D//g; $temp_section =~ s/^[0]+//; if ($temp_seciton < 10) {$temp_section = "00$temp_section";} elsif ($temp_section < 100) {$temp_section = "0$temp_section";} ($prefix,$suffix) = split (/\./,$key,2); $course_inputs .= "\n"; $course_inputs .= "\n"; $course_inputs .= "\n"; } } if ($ENV{'HTTP_COOKIE'} !~ /\w/) { $out .= "It appears that you have not yet selected any courses.\n"; $out .= "If you have chosen a course, then most likely your web browser is not configured to accept cookies, which are needed to hold your course information.\n"; $out .= "If this is the case, please change your browser configuration, if you would like to register online.\n"; } else { if ($numcourses > 0) { $out .= "
| Remove All |
| Course Code | \n"; $out .= "Sect. | \n"; $out .= "Course Name | \n"; $out .= "Fee | \n"; $out .= "Days/Time | \n"; $out .= "Instructor | \n"; $out .= "|
| $key | \n"; $out .= "$cookies{$key} | \n"; $out .= "$courseinfo[4] | \n"; $out .= "\$$courseinfo[2] | \n"; $out .= "$theperiod | \n"; $out .= "$facname | \n"; $out .= "Remove |
\n"; $out .= "
Print Registration Form"; } else { $out .= "You have not selected any courses."; $out .= "
Please browse our site for a complete listing of available courses.";
$out .= " Or, go Directly to Albert.\n";
$out .= "";
}
}
if (open(FILE,"$testdir/Study_Options$cmd.html") || open(FILE,"$livedir/Study_Options$cmd.html")) {
while ($nextline =