title: How to post data with jQuery
body: <p>I'm using PHP to submit a very simple data to db. On my page.php, I have a link, by clicking it I insert its id and some other data in the database. For example:</p>
  
  <pre><code>echo "&lt;a href='".$base_url."?submit=$page_id'&gt; Submit it&lt;/a&gt;";
  </code></pre>
  
  <p>It generates the url like page/test-page/?submit=12 </p>
  
  <p>On the top of the page I get the page id with $_GET and insert it to the db in the following way:</p>
  
  <pre><code>if (isset($_GET["submit"])) {
          $page_id = $_GET['submit'] //yes, its not secure.       
          //insert in db.     
          //get db success/error msg in $db_msg       
      }
  </code></pre>
  
  <p>How can I submit the data and get the database success or fail message without refreshing the page.</p>