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 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 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 :'( 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"); 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."); } 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. Link to comment https://forums.phpfreaks.com/topic/238353-strlen-strlen-password-length/#findComment-1224912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.