title: Echo form successfull submittted in a new page
body: <p>I have 2 php files.</p>
  
  <p>The first (add.php) contain a form that submit data into the database with:</p>
  
  <pre><code>&lt;form  action="post.php" method="post"&gt;
  </code></pre>
  
  <p>The second (post.php) contain just the php code that add the info in the database with:</p>
  
  <pre><code>header("location:add.php");
  </code></pre>
  
  <p>Now everything is working (i can add the info in the db and after submission i get redirected to the add.php page), but I was wondering how can I implement a message in this last page that says the recor has been addess successfully?</p>
  
  <p>If I dont use the redirect header location the php code just show me the echo "record addedd successfully but does not redirect me in the form page."</p>
  
  <p>Here the two files...</p>
  
  <pre><code>&lt;?php
  $link = mysqli_connect(.................);
  
  // Check connection
  if($link === false){
      die("ERROR: Could not connect. " . mysqli_connect_error());
  }// attempt insert query execution
  $sql = "INSERT INTO ..........{
   // echo "Records added successfully.";
      header("location:add-customer.php");
  } else{
      echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
  }
  // close connection
  mysqli_close($link);
  ?&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;form  action="post.php" method="post"&gt;
  .....
  .....
  
   &lt;button type="submit"  name="submit" class="btn btn- default"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>