0

My password validation is not working, i don't see any errors but it's still not working can somebody help me

<?php $password=""; $password_confirm=""; $error_array=array(); if(isset($_POST['Signup'])){ $password=strip_tags($_POST['reg_password']); $password_confirm=strip_tags($_POST['password_confirm']); if(strlen($password >30 ||($password <6))){ array_push($error_array,"Your password must be between 6 and 30 characters<br>"); } if($password != $password_confirm){ array_push($error_array,"Passwords do not match<br>"); }else{ if(preg_match('/^A-Za-z0-9/',$password)){ array_push($error_array,"Sorry, Your password can only contain Alphabets and numbers<br>"); } } } ?> <html> <head></head> <body> <form> <input type="password" name="reg_password" placeholder="Password" required></input><br> <input type="password" name="password_confirm" placeholder="Confirm Password" required></input><br> <?php if(in_array("Passwords do not match<br>",$er

29th Sep 2020, 8:51 AM
Kennedy Agyeman Duah
Kennedy Agyeman Duah - avatar
6 odpowiedzi
+ 1
May this will help you import re pw = input() char = re.findall(r'[a-zA-Z]',pw) num = re.findall(r'[0-9]', pw) spl = re.findall (r'[!@#$%&*]', pw) if len(pw)>=7 and len(num)>=2 and len(spl)>=2: print('Strong') else : print ('Weak')
29th Sep 2020, 9:07 AM
🔰Saurabh🔰
🔰Saurabh🔰 - avatar
0
please can you describe your problem better. what validation fails?
29th Sep 2020, 8:53 AM
JustCodeMore
JustCodeMore - avatar
0
All the validations are not working
29th Sep 2020, 8:55 AM
Kennedy Agyeman Duah
Kennedy Agyeman Duah - avatar
0
the code you gave is incomplete. give me the link to test the code
29th Sep 2020, 8:57 AM
JustCodeMore
JustCodeMore - avatar
29th Sep 2020, 9:04 AM
Kennedy Agyeman Duah
Kennedy Agyeman Duah - avatar
0
You need to make a config.php file before testing since i transferred it from pc to mobile. Due to this no config file exist
29th Sep 2020, 9:07 AM
Kennedy Agyeman Duah
Kennedy Agyeman Duah - avatar