reCAPTCHA V2 Not stopping registration

Hello! I am having reCAPTCHA V2 problems. It seems yesterday it was fine and now it is not working. It is inputting the data to my database even without the recaptcha being checked. Here is my code, I hope I can get some help.

<?php
// Include the file that configures the DB.
include 'includes/db-config.inc.php';
?>

<?php
session_start();
if (isset($_POST["username"])) {
        $email = test_input($_POST["email"]);
        if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
                die("Invalid email");
        }
        if (!empty($_POST["username"]) && (!empty($_POST["password"])) && (!empty($_POST["email"]))) {
                $userDAO = new UserDAO($connection);
                if (strlen($_POST['password']) < 5) {
                        die("Passwords must be 5 characters or longer");
                } else {
                        $user = new User($_POST["username"]);
                        $user->setPassword($_POST["password"]);
                        $user->setEmail($_POST["email"]);
                        $userDAO->createUser($user);
                        $_SESSION['username'] = $_POST['username'];
                        // header("location:reg-success.php");
                }
        } else {
                die("All Fields are required");
        }
}
function test_input($data)
{
        $data = trim($data);
        $data = stripslashes($data);
        return $data;
}
?>

<?php
 if(isset($_POST['submit']) && $_POST['submit'] == 'SUBMIT'){
  if(isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response']))
  {
        $secret = 'myKeyGoesHere';
        $verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
        $responseData = json_decode($verifyResponse);
        if($responseData->success)
        { 
            header("location:reg-success.php");
            ?>
        <div style="color: limegreen;"><b>You have successfully registered!</b></div>
            
        <?php }
        else
        { die("Verification failed, please try again."); ?>
            <!--<div style="color: red;"><b>Verification failed, please try again.</b></div>-->
        <?php }
   }else{ die("Please complete the captcha"); ?>
        
    //   <div style="color: red;"><b>Please complete the captacha.</b></div>
   <?php }
 }
?>

<!DOCTYPE html>  
 <html>  
      <head>  
      <link rel="stylesheet" type="text/css" href="main.css">

           <title>New Website</title>
        <script src="https://www.google.com/recaptcha/api.js" async defer></script>
           <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>  
           <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />  
           <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>  
         
      </head>  
      <body>  
           <br /><br />  
           <div class="container" style="width:500px;">  
           <img src="Logo_1_AP.png" alt="Logo" class="center">
                <h3 align="center"><b>Register!</h3>  
                </b><br/>  
              
                <h3 align="center">Register</h3>  
                <br />  
                
   
                         <form action="" method="POST" style="width: 80%;">
                   
                         <label>Enter Username</label> 
                        <input type="text" name="username" class="form-control" /> 
                        <label>Enter Password</label> 
                        <input type="text" name="password" class="form-control" /> 
                        <label>Enter Email</label> 
                        <input type="text" name="email" class="form-control" /> 
                        <br>
                        <br>
                        <div class="g-recaptcha" data-sitekey="My-SiteKey"></div><br><br>
                        <input type="submit" name="submit" value="SUBMIT">
                        </form>   
 
                

           </div>  
      </body>  
 </html>