#!/usr/bin/perl -w #----------------------------------------------- # Login version 2 # # Purpose: Receive username and password through # CGI, and prints them in an HTML document. # Exactly as in login1.cgi, except using cleaner print # statements. # # Author: H.L. Hiew # Created: 10/07/2000 # Last modified: 10/08/2001 # #----------------------------------------------- use CGI qw(:standard) ; # get the user-supplied name and passwd from CGI my $username = param("name") ; my $passwd = param("passwd") ; # print the values as HTML document print <

Login Page version 2


Username is $username

Password is $passwd

END # # Two very important things to look out for in the print statement # 1. There MUST be TWO newline characters at the end of the Content-type # line. # 2. There MUST be NO spaces at the beginning of the Content-type line. # 3. There MUST be NO spaces before or after the last END label. #