Jump to content
Sign in to follow this  
rjsma

Ajudinha com a função strlen

Recommended Posts

rjsma

Boas rapaziada,

Precisava da vossa ajudinha para conseguir ver o que está mal neste if no qual utilizo a função strlen para contar o numero de caracteres de uma input, hoje de manha fiz um echo a variavel utilizada no strlen e mostrou-me 31 caracteres, era impossivel aparacer 31 caracteres porque a caixa de texto estava vazia. Também verifiquei se colocar algum texto ele incrementa o numero de caracteres inseridas aos 31 (Exemplo|| Azevedo = 6 caracteres, fica 31+6).

if (strlen($nova_senha)<5 && strlen($nova_senha)>25) { 
$erro_nova_senha_tamanho=1;
$erros++;
}

Cumprimentos

Share this post


Link to post
Share on other sites
KTachyon

Até porque é impossível entrar nesse if.


“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

-- Tony Hoare

Share this post


Link to post
Share on other sites
rjsma

Se queres saber, nem eu. Depois de mudar o sinal nunca mais contou os 31 caracteres, devia estar a contar uma coisa qualquer que nao estava a ver.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.