clown[NOR] Posted April 22, 2007 Share Posted April 22, 2007 I'm trying to check the length of username and password.. but it keeps on returning "Feil lengde" (translation: wrong lenght) .. this is the code: i've tried both this: if (strlen($tmpUser) > 4 && strlen($tmpUser) < 10 && strlen($tmpPass) > 6 && strlen($tmpPass) < 12) { echo "Logg inn"; } else { echo "Feil lengde"; } and this: if ((strlen($tmpUser) > 4) && (strlen($tmpUser) < 10) && (strlen($tmpPass) > 6) && (strlen($tmpPass) < 12)) { echo "Logg inn"; } else { echo "Feil lengde"; } but with no luck.. any ideas? Thanks In Advance - Clown Link to comment https://forums.phpfreaks.com/topic/48088-solved-help-cant-solve-this-if-statement/ Share on other sites More sharing options...
hackerkts Posted April 22, 2007 Share Posted April 22, 2007 Try to change && to ||. Link to comment https://forums.phpfreaks.com/topic/48088-solved-help-cant-solve-this-if-statement/#findComment-235008 Share on other sites More sharing options...
clown[NOR] Posted April 22, 2007 Author Share Posted April 22, 2007 well.. it does show "Logg inn" now... but it appears even if the username is smaller than 4 and password is smaller than 6.. so... i'm sorry... not working Link to comment https://forums.phpfreaks.com/topic/48088-solved-help-cant-solve-this-if-statement/#findComment-235012 Share on other sites More sharing options...
clown[NOR] Posted April 22, 2007 Author Share Posted April 22, 2007 oh well... i feel reallys stupid now... i forgot i was using md5 and it was making sure that the password was less then 12 chars long so... no wonder it didnt work..hehe.. Link to comment https://forums.phpfreaks.com/topic/48088-solved-help-cant-solve-this-if-statement/#findComment-235013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.