Page 1 of 1

field minimum

Posted: Wed Oct 28, 2009 9:48 am
by adsegzy
Hello there,

how do i code my password field to take minimum of 6 characters.
secondly, is it possible to code MT_RAND to generate a particular maximum numbers of characters for my confirmation code.

regards,
Olusegun

Re: field minimum

Posted: Wed Oct 28, 2009 12:46 pm
by daktau
Since you're posting on this php board I'm assuming that you want to use php to determine the password length involving a trip and back to the server.

You could always use javascript for a clientside check and / or the php.

for php use something like this...

<?
$minimum_password_length = 6;
$password = $_POST['password'];

if(strlen($password)>$minimum_password_length){
//do here what you want to do if the password does not meet the minimum length
}else{
//do here what you want to do otherwise...
}
?>


cheers,
George.

Re: field minimum

Posted: Wed Oct 28, 2009 1:55 pm
by adsegzy
Thanks alot daktau, i reallly appreciate your help.
much love