#!/usr/bin/perl -wT use strict; use CGI; my $q= CGI->new(); my $name = $q->param('name'); my $password = $q->param('password'); while ( my($u , $p ,,) = getpwent ) { if ($name eq $u) { my $salt = substr($p,0,2); my $check = crypt ($password, $salt); if ($check) { # yes yes, it's always true - FOR NOW! &success; } else { &fail }; } } &fail; exit(0); sub fail { print $q->header('text/html'), $q->start_html(-title=>'Unsuccessful Login'), $q->a({href=>'http://proxy/testform.html'} ,'Return to Login Page'), $q->end_html; exit(0); } sub success { my $cookie = $q->cookie(-name=>'id', -value=>$name , -expires=>'-1h'); print $q->header(-type=>'text/html', -cookie=>$cookie), $q->start_html(-title=>"Welcome $name"), $q->a({href=>'http://proxy/cgi-bin/view/browse.pl?test=1'}, 'Proceed to Viewing Area'), $q->end_html; exit(0); } #### #!/usr/bin/perl -wT use strict; use CGI; use Data::Dumper; my $q= CGI->new; my $cookie = $q->cookie('id'); #This keeps returning undef