problem using &&

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
I am reading a username and password from a file. For the moment I am trying to test if the username and password are the same as user inputted username/password.
My code snippet is as follows:
if( $out[0][0] == $u && $out[0][1] == $p ) {
			$error = "Login successful!";
		}
	else {
			$error = "Invalid username/password. Try again";
		}

$out[] is an array containing the file data.
$u is the form username and $p the password.
I echo both values once submitted. Even when they match I get invalid username/password message.
If I just test if( $out[0][1] == $u ) it works.
Has anyone any pointers on what I am doing wrong?
Thanks
Eoghan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux