Hey Guys/Gals
I’m trying to figure out a snippet to use that will create a strong password using upper, lower numbers and special characters BASED on user input… the form asks users if they want to include special chars, numbers, lower and upper…
based on the input it generated the password… what I can’t figure out is how to change the string based on input…
example, I tried this and I know it’s completely off
[php]if (!empty($_POST)) {
$incl_num = $_POST[‘incl_num’];
$special = $_POST[‘special’];
$upper = $_POST[‘upper’];
$lower = $_POST[‘lower’];
$length = $_POST[‘length’];
$set1 = ‘abcdefghijklmnopqrstuvwxyz’;
$set2 = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’;
$set3 = ‘123456789’;
$set4 = ‘!$%^&)’;
$generate = TRUE;
$set1 = $set1.if($incl_num==yes){echo $set3;}.if($special==yes){echo $set4;}.if($upper==yes){echo $set2;};[/php]
The idea was to have a base set being the lowercase number set and then check if the user requested the other sets and append them to the end of the original set…
any help would be appreciated.