Welcome Guest, Not a member yet? Register   Sign In
MeNeedz Password
#7

[eluser]Iverson[/eluser]
Cool. I'm hooking this in with xajax and asynchronously displaying how secure (or insecure) the password is. One thing I did change however, was the return values. Instead of strings, you might want to turn this into a lib so people can dynamically change the values with a config file. This would take care of the language barriers, etc. In my case, I just used the code below so I can do what I want with the values. Great idea for a helper...

Code:
$very_secure = 7;
$secure = 6;
$very_strong = 5;
$strong = 4;
$average = 3;
$weak = 2;
$very_weak 1;

//result
        if($_points >= 90)
        {
            return $very_secure;
        }
        else
        {
            if($_points >= 80)
            {
                return $secure;
            }
            else
            {
                if($_points >= 70)
                {
                    return $very_strong;
                }
                else
                {
                    if($_points >= 60)
                    {
                        return $strong;
                    }
                    else
                    {
                        if($_points >= 50)
                        {
                            return $average;
                        }
                        else
                        {
                            if($_points >= 25)
                            {
                                return $weak;
                            }
                            else
                            {
                                return $very_weak;
                            }
                        }
                    }
                }
            }
        }
    }


Messages In This Thread
MeNeedz Password - by El Forum - 01-02-2009, 04:28 AM
MeNeedz Password - by El Forum - 01-04-2009, 04:51 AM
MeNeedz Password - by El Forum - 01-04-2009, 10:17 AM
MeNeedz Password - by El Forum - 01-04-2009, 11:08 AM
MeNeedz Password - by El Forum - 01-04-2009, 12:16 PM
MeNeedz Password - by El Forum - 01-04-2009, 02:41 PM
MeNeedz Password - by El Forum - 01-04-2009, 10:13 PM
MeNeedz Password - by El Forum - 01-05-2009, 03:01 AM
MeNeedz Password - by El Forum - 01-05-2009, 12:13 PM
MeNeedz Password - by El Forum - 01-05-2009, 12:26 PM
MeNeedz Password - by El Forum - 01-05-2009, 01:08 PM
MeNeedz Password - by El Forum - 01-05-2009, 01:15 PM
MeNeedz Password - by El Forum - 01-05-2009, 02:34 PM
MeNeedz Password - by El Forum - 01-05-2009, 02:45 PM
MeNeedz Password - by El Forum - 01-05-2009, 02:52 PM
MeNeedz Password - by El Forum - 01-23-2009, 11:01 PM
MeNeedz Password - by El Forum - 06-30-2009, 06:38 PM
MeNeedz Password - by El Forum - 07-01-2009, 01:36 AM
MeNeedz Password - by El Forum - 07-01-2009, 07:10 PM
MeNeedz Password - by El Forum - 07-02-2009, 02:03 AM
MeNeedz Password - by El Forum - 07-02-2009, 06:28 AM
MeNeedz Password - by El Forum - 07-02-2009, 06:29 AM
MeNeedz Password - by El Forum - 07-02-2009, 07:03 AM
MeNeedz Password - by El Forum - 07-02-2009, 09:00 AM
MeNeedz Password - by El Forum - 07-02-2009, 09:36 AM
MeNeedz Password - by El Forum - 01-02-2010, 07:26 AM
MeNeedz Password - by El Forum - 01-02-2010, 07:35 AM
MeNeedz Password - by El Forum - 01-02-2010, 07:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB