title: What's wrong with my login form code?
body: <p>I got this code as part of my login form, but I tried and I can still login without even using a password. I changed everything to be case sensitive, my code seems to have no syntax errors, and I'm stumped.</p>
  
  <pre><code>if ($_POST['login']) {
  
  $query= "SELECT * FROM users WHERE email='".mysqli_real_escape_string($link, $_POST['loginemail'])."' AND password='".md5(md5($_POST['loginemail'])+$_POST['loginpassword'])."' LIMIT 1";
  $result= mysqli_query($link, $query);
  $row= mysqli_fetch_array($result);
  
  if ($row) {
  
      $_SESSION['id']= $row['id'];
    header("location:mainpage.php");
  
   } else {
  
    $error= "We could not find any user with the submitted informations!";
  }
  
  }
  </code></pre>