#!/usr/bin/perl -wT use strict; use CGI; use CGI::Cookie; my $query = new CGI; my $good_user = ""; my $good_pass = ""; my $real_user = ""; my $real_pass = ""; my $itis = ""; use vars qw($incuser $incpass); &url if $query ->request_method() eq "GET"; my $pword_file = "/location/of/file/.password"; #will use database later but for now keep file my $userid_entd = $query->param('incuser'); my $pword_entd = $query->param('incpass'); $userid_entd =~ tr/A-Z/a-z/; $pword_entd =~tr/A-Z/a-z/; &url if $userid_entd =~ /[^0-9a-z]/; &url if $userid_entd eq ""; $good_user = $userid_entd; &url if $pword_entd =~ /[^0-9a-z]/; &url if $pword_entd eq ""; $good_pass = $pword_entd; #### open (USERFILE, $pword_file) || die "File cannot open"; while () { chomp; ($real_user, $real_pass) = split /\|/; if ($real_user eq $good_user && $real_pass eq $good_pass) { my $stime = time; my $c = $query->cookie( -name => 'ID', -value => "${stime}${good_user}99", -expires => '+1h', -domain => '.domain.com', -path => '/some/path', ); print $query->header( -cookie => $c); # print "Set-Cookie: $c\n"; #this was tried, also didn't work $itis="good"; &url; } } close (USERFILE); &url; #&url prints a header and checks to see if $itis eq "good" #print one message if it is another if it isn't