stophon4
07-15-2004, 05:42 PM
For some really weird reason, the if statement is always returning true no matter what the other statement is!
#!/usr/bin/perl
use CGI ':standard';
$user = param('user');
$pass = param('pass');
print "Content-type: text/html\n\n";
print "Username: $user <BR> \n"; # This changes every time
print "Password: $pass <BR> \n"; # So does this
if($user == "Stophon4" && $pass == "PASSWORD")
{
print "You typed the correct username and password. <BR> \n"; # But it always returns this
}
else
{
print "You typed an invalid username or password! <BR> \n";
}
It always prints that I typed the correct username and password, no matter what I type! When I print out the username and password, they change, but the if statement, even if I type in the wrong user or password, always returns that I typed the correct username and password :mad:
#!/usr/bin/perl
use CGI ':standard';
$user = param('user');
$pass = param('pass');
print "Content-type: text/html\n\n";
print "Username: $user <BR> \n"; # This changes every time
print "Password: $pass <BR> \n"; # So does this
if($user == "Stophon4" && $pass == "PASSWORD")
{
print "You typed the correct username and password. <BR> \n"; # But it always returns this
}
else
{
print "You typed an invalid username or password! <BR> \n";
}
It always prints that I typed the correct username and password, no matter what I type! When I print out the username and password, they change, but the if statement, even if I type in the wrong user or password, always returns that I typed the correct username and password :mad: