Re: problem using &&
| From: | php at redry dot net | Date: | Wed, 26 Jul 2006 14:43:18 +0000 |
| Subject: | Re: problem using && | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239817@lists.php.net to get a copy of this message | ||
On Wed, 26 Jul 2006 14:53:34 +0200, Jochem Maas <jochem@iamjochem.com> wrote:
> php@redry.net wrote:
>>
>> On Wed, 26 Jul 2006 13:54:15 +0200, Jochem Maas <jochem@iamjochem.com>
> wrote:
>>> var_dump($out, $u, $p, (" user " == "user"));
>>
>> Jochem
>> Thank you, var_dump showed me i had an extra space at the end of the
> password. I trimmed the vales from the file and it works fine now.
>
> LOL - that's one lesson/trick you probably won't forget in a hurry...
> most of us have had similar experiences at one time or the other!
I sure wont.
On the topic of my array, what would be an efficient way of checking my username/passwordd pairs
match the user input form my login form.
The text file contains username and passwords in the following format:
username1,password1
username2,password2
Given I have only 2 its easy to do this in one if statement testing like so:
if( ($out[0][0]) == ($u) && ($out[0][1]) == ($p) || $out[1][0] == $u && $out[1][1]
== $p )
But if I had more or n amount, what would be an efficient way to check the pairs?
Thanks
Eoghan