title: How I send data to the database without refresh the page
body: <p>How  I send data to the database without refresh the page
  and send the data to the database without pressing the submit button </p>
  
  <p>I saw many explanations, but all depends on  button ,, when pressing a button data is  sent to the database without refresh the page</p>
  
  <p>I want is how to send the data to the database without pressing the submit button </p>
  
  <p>I want  With pressure on the script data to be sent directly and without refresh the page</p>
  
  <p>try this</p>
  
  <pre><code>&lt;script&gt;
  
  $(function(){
  
    var A = {name:'khaled', password: 1234, submit: 'submit'};
  
      $.post('index.php',A,function(data){   
  
      return false;
  
      alert("OK");
  });
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>But did not send the data to the database</p>
  
  <p><strong>and try this</strong></p>
  
  <pre><code>&lt;script&gt;
  
  $(function(){
  
    var A = {name:'khaled', password: 1234};
  
      $.post('index.php',A,function(data){
  
      $(data).find("input[name=submit]").click();
  
      return false;
  
      alert("OK");
  });
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>But updated Page</strong></p>
  
  <p>(index.php)</p>
  
  <pre><code>&lt;body&gt;
  
  user : &lt;input type="text" name='name' /&gt;
  password : &lt;input type="text" name='password' /&gt;
  &lt;input type="submit" name='submit' value='موافق' /&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p><strong>How do I send data to the database without pressing the submit button ??!!
  and how I send data to the database without refresh the page  ??!!</strong></p>
  
  <p>I do not want to press this button for data to be sent</p>
  
  <pre><code>&lt;input type="submit" name='submit' value='موافق' /&gt;
  </code></pre>
  
  <p><strong>I want to send the data directly</strong></p>