my $q = new CGI; print $q->redirect("http://busybody.w1.com/html/2010assignment.html"); #### #!/usr/local/bin/perl -w # 2010b.pl use CGI; require ("cgi-lib.pl"); my $q = CGI->new(); print $q->header(); $studentid = $q->param('studentid'); $password = $q->param('password'); $CSC = $q->param('CSC'); $assignment = $q->param('assignment'); $file = $q->param('path'); if ($CSC eq "CSC2010") { $openfile = "CSC2010.txt"; open (IN, "<$openfile") or die "Can't open $openfile\n"; $foundusername = false; $foundpassword = false; while ($line = ) { chomp($line); my ($realstudentid,$realpassword) = split /\|/, $line; if ($realstudentid eq $studentid){ $foundusername = true; if ($realpassword eq $password){ $foundpassword = true; print $q->redirect("http://busybody.w1.com/html/2010assignment.html\n\n"); exit; } } } if ($foundusername eq false ) { print "username not found!
"; } if ($foundpassword eq false) { print "bad password!
"; } }