Skip to content

Commit

Permalink
Merge pull request #23 from divya7202/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Vimall03 authored Oct 3, 2024
2 parents 58dbbc2 + 52ab49e commit e51cf80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"php.validate.run": "onSave"
}
5 changes: 5 additions & 0 deletions user_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@
include 'partials/_dbconnect.php';
$email = $_POST["email"];
$password = $_POST["password"];
// Password complexity pattern (at least one lowercase, one uppercase, one digit, one special char, and minimum 8 characters)
$pattern = '/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[\W_]).{8,}$/';
//to check if the password/ email is blank
if($email == '' || $password == ''){
$showError = "Enter valid Email/password";
}
elseif (!preg_match($pattern, $password)) {
$showError = "Password must be at least 8 characters long, include at least one uppercase letter, one lowercase letter, one digit, and one special character.";
}
//if not blank then go to else
else {
$sql = "select * FROM users where email = '$email'";
Expand Down

0 comments on commit e51cf80

Please sign in to comment.