#!/usr/bin/perl # # Login CGI use CGI ':standard'; # send required HTTP response header and blank line. print "Content-type: text/html\n\n"; # Get the name and password from the query $user =param('name'); $pw = param('password'); # Make sure the name and password are correct if (($user eq "dave") && ($pw eq "eiw")) { print "

Welcome $user, you are valid.

\n"; } else { print "

You are not valid!

\n"; sendfile("form.html"); } sub sendfile() { my($filename) = $_[0]; open(F,$filename); while () { print; } close(F); }