Set Minimum Password Length In PHP

RegisterLogin
Set Minimum Password Length In PHP
Post Description: I Want To Know How To Set The Minimum Password Legnth On Each Login Page So My Users Can Create Long Secured Passwords
Tags: Set, Minimum, Password, Length, Php
This Post Was Posted On Oct 18, 2009 By Akon #2588
i want be able to make my login page more secure, i have seen some users they are entering and submitting very short passwords on their forms and i want to make it longer, like fore example, there was this subscriber who's password was only one character, i want to make so at least it should be 6 characters or more but not less.

if you can help me how to do this on my php script, thanks
Leave Your Comments
webune
#2602 1
you can use the strlen() in php. the strlen() functions counts the number of character that are in a string.
<?php
if(strlen($password) < 6){
	echo 'ERROR: password is too short';
}else{
	echo 'Congratulations! Your password is secured';
}
?>
Oct 18, 2009 Reply Report abuse
©2011 Webune Forums - Sun Dec 18, 2011 10:05 pm
Powered by: Webune Forums V3