rebornishard Posted June 3, 2011 Share Posted June 3, 2011 elseif(strlen($pass) > 5 ){ header("location:register.php?msg=your password at least 6 char"); } elseif(strlen($pass) < 29 ){ header("location:register.php?msg=your password must more than 30 char"); how to make this work thanks Quote Link to comment https://forums.phpfreaks.com/topic/238353-strlen-strlen-password-length/ Share on other sites More sharing options...
The Little Guy Posted June 3, 2011 Share Posted June 3, 2011 by running it in your browser your welcome Quote Link to comment https://forums.phpfreaks.com/topic/238353-strlen-strlen-password-length/#findComment-1224906 Share on other sites More sharing options...
rebornishard Posted June 3, 2011 Author Share Posted June 3, 2011 by running it in your browser your welcome after click register , 4 characters or 31 characters still accepted :'( Quote Link to comment https://forums.phpfreaks.com/topic/238353-strlen-strlen-password-length/#findComment-1224908 Share on other sites More sharing options...
The Little Guy Posted June 3, 2011 Share Posted June 3, 2011 I think you need a space between the colon and the file: header("location: register.php?msg=your password at least 6 char"); Quote Link to comment https://forums.phpfreaks.com/topic/238353-strlen-strlen-password-length/#findComment-1224909 Share on other sites More sharing options...
dougjohnson Posted June 3, 2011 Share Posted June 3, 2011 if (strlen($pass) < 5 ) { header("location:register.php?msg=Your password must be at least 6 characters."); } else if(strlen($pass) > 29 ) { header("location:register.php?msg=Your password must be less than 29 characters."); } Quote Link to comment https://forums.phpfreaks.com/topic/238353-strlen-strlen-password-length/#findComment-1224911 Share on other sites More sharing options...
Pikachu2000 Posted June 3, 2011 Share Posted June 3, 2011 What's with this recent trend of using header() redirects while validating forms? That makes it quite inconvenient for the user, as they then have to go back and reenter anything they'd already filled out unless you've actually taken the time to store that data in a $_SESSION var or cookie. Quote Link to comment https://forums.phpfreaks.com/topic/238353-strlen-strlen-password-length/#findComment-1224912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.