Re: Case sensitive password
| From: | Andrew Ballard | Date: | Fri, 20 Jun 2008 17:05:55 +0000 |
| Subject: | Re: Case sensitive password | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-275715@lists.php.net to get a copy of this message | ||
On Thu, Jun 19, 2008 at 7:29 PM, Kyle Browning <nomspes@gmail.com> wrote:
> Why not md5 the password, and store the md5 encryption.
> Then when they type something in, md5 it and compare the md5 strings.
> That will ensure that it is Case Sensitive
>
> On Thu, Jun 19, 2008 at 2:04 PM, R.C. <rme@besttranslation.org> wrote:
>
>> Thank you Daniel, I think that did the trick. Am checking this out now...
>>
>> Best
>> R.C.
>>
>> ""Daniel Brown"" <parasane@gmail.com> wrote in message > >
>> session_start();
>> > >
>> > > $_SESSION ['userpass'] = $_POST ['pass'];
>> > > $_SESSION ['authuser'] = 0;
>> > >
>> > > $login = "VIDEO";
>> > > $login2 = "video";
>> > >
>> > > if (($_SESSION['userpass'] == $login) or
>> > > ($_SESSION['userpass'] ==
>> $login2))
>> > > {
>> > > $_SESSION['authuser'] = 1;
>> > > ?>
>> >
>> > Try this:
>> >
>> > <?php
>> >
>> > if(preg_match('/^'.$_SESSION['userpass'].'$/i',$login))
>> > {
>> > echo "Good.\n";
>> > } else {
>> > echo "Bad.\n";
>> > }
>> >
>> > ?>
Because that would make the password comparison case-sensitive (as one
might reasonably infer from the subject of the message). However, the
OP wanted the password to be case-INsensitive.
Andrew