$_POST how to check for email and password? [closed]

if(!isset($_POST['email'], $_POST['password'])) {
    exit('Please fill both the email and password fields!');
}

I put both the email and password into the input fields but it is saying the error. How do I solve this? Thank you.

If both inputs are filled, it should do this but it doesn’t:

if($stmt = $con->prepare('SELECT id, password FROM accounts WHERE email = ?')) {
    $stmt->bind_param('s', $_POST['email']);
    $stmt->execute();
    $stmt->store_result();

    if($stmt->num_rows > 0) {
        $stmt->bind_result($id, $password);
        $stmt->fetch();

        if(password_verify($_POST['password'], $password)) {
            session_regenerate_id();
            $_SESSION['loggedin'] = true;
            $_SESSION['name'] = $_POST['email'];
            $_SESSION['id'] = $id;
            echo 'Welcome' . $_SESSION['name'] . '!';
        } else {
            echo 'Incorrect email and/or password!';
        }
    } else {
        echo 'Incorrect email and/or password';
    }

    $stmt->close();

HTML CODE:

        <form action="authenticate.php" method="post">
                  <div style="display: inline-block; text-align:left;">

      <div>
      <label for="name">Email Address:</label>
      <input type="email" name="email" id="email" placeholder="Enter your email address" />
      </div>
      <div>
      <label for="password">Password:</label>
      <input type="password" name="password" id="password"  placeholder="Enter your password" />
      </div>

  </div>

     <div class="checkbox">
     <label><input type="checkbox" class="checkbox" />Remember me</label>
      </div>

<input type="submit" value="Login" />