title: How to Transfer Message to index.html after checking duplicate value?
body: <p>Action.php  </p>
  
  <pre><code>class dataOperation extends Database{
      public function check_Duplicate(){
         $email = $_POST["email"];
         $number = mysqli_query($this-&gt;conn,"SELECT Email FROM member where Email='$email'");
         if (mysqli_num_rows($number)){
           echo "Email is taken"
         } else return true;
      } 
   }
  
  $obj = new dataOperation;
  
  if(isset($_POST["submit"])){
   if( $obj-&gt;check_Duplicate()){
      if($obj-&gt;insert_record("member",$myArray)){
        header("Location: ../index.html");
        exit;
      };
   };
  }
  </code></pre>
  
  <p>I am trying to print error message from action.php to index.html. How can I print "Email is taken" in index.html instead of action.php?</p>