title: PHP - variables not comparing to one another
body: <p>I am doing a password reset page for my website and when a user puts a new password on the <code>&lt;form method="post" action="passVerif.php"&gt;</code> it goes to the PHP with this code:</p>
  
  <p>Until now I cannot make the php compare the two new entered passwords to verify if they are equal or not, it simply jumps over that part.</p>
  
  <p>P.S. don't mind the <code>$senha = md5($password)</code> it is like this for easy troubleshoot on localhost (MAMP).</p>
  
  <pre><code>&lt;?php
  session_start();
  include("connectivity.php");
  
  $user_id = $_SESSION['ResetUtilizadorID'];
  $password1 = $_POST['password1'];
  $password2 = $_POST['password2'];
  
  $sql = mysqli_query($conn, "SELECT FROM usuarios WHERE id =".$user_id."");
  $password = $password1;
  $senha = md5($password);
  $adminID = $_SESSION['usuarioNiveisAcessoId'];
  
  if (strcmp($user_id,$adminID) == 0) {
  $_SESSION['avisoReset'] = "not possible to change admin password.";
  header('Location: ../login/reset_password.php');
  } else {
  while ($row = mysqli_fetch_array($query)) {
      if ($senha == $row['senha']){
          $_SESSION['avisoReset'] = "password taken";
          header('Location: ../login/reset_password.php');
      }
  }
  if ($password1 == $password2){
          mysqli_query($conn, "UPDATE usuarios SET senha = '".$senha."' WHERE id='".$user_id."'");
          $sql = 'SELECT * FROM usuarios';
  
          $query = mysqli_query($conn, $sql);
  
          if (!$query) {
              die ('SQL Error: ' . mysqli_error($conn));
          }
  
          $_SESSION['avisoReset'] = "new passoword set";
          //header('Location: ../login/reset_password.php');
      } else {
          $_SESSION['avisoReset'] = "Passwords not equal!";
          header('Location: ../login/reset_password.php');
      }
  }
  ?&gt;
  </code></pre>