field minimum

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

field minimum

Post 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
daktau
Forum Newbie
Posts: 3
Joined: Wed Oct 28, 2009 7:07 am

Re: field minimum

Post 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.
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

Re: field minimum

Post by adsegzy »

Thanks alot daktau, i reallly appreciate your help.
much love
Post Reply