Skip to content

UNSAFE php-user-authentication/controllers/login.php / #4

Description

@Raisel

for things like that I gave up on third-party classes, making your own should be safer, since only you can know where there is a hole in the code ...

ln17: $sql = "SELECT * From users WHERE email = '{$email_signin}' ";
I think it should be
$sql = "SELECT * From users WHERE email = '{$user_email}' ";

see how it is today:

if(isset($_POST['login'])) {
$email_signin = $_POST['email_signin'];
$password_signin = $_POST['password_signin'];

    // clean data 
    $user_email = filter_var($email_signin, FILTER_SANITIZE_EMAIL);
    $pswd = mysqli_real_escape_string($connection, $password_signin);

    // Query if email exists in db
    $sql = "SELECT * From users WHERE email = '{$email_signin}' ";
    $query = mysqli_query($connection, $sql);
    $rowCount = mysqli_num_rows($query);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions