title: jquery using ajax to send data and save in php
body: <p>Good day im am trying to send or get data from a form and then using jquery and then ajax to send the data into a php page that should save it in the database how can i do it in jquery and use ajax to do it, any help will do and thanks!</p>
  
  <p>HTML page 1 that will use jquery ajax to send data into the php page</p>
  
  <pre><code> &lt;form&gt;
         Name:&lt;input type='text' name='name'&gt;
         E-mail:&lt;input type='text' name='email'&gt;
         Gender:&lt;select name='gender'&gt;
         &lt;option value='male'&gt;male&lt;/option&gt;
         &lt;option value='female'&gt;female&lt;/option&gt;
         &lt;/select&gt;
         Message:&lt;textarea name='about'&gt;&lt;/textarea&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>PHP page 2 that would recieve the data from the page 1 form</p>
  
  <pre><code>&lt;?php
  echo "
   $_POST['name'];
   $_POST['email'];
   $_POST['gender'];
   $_POST['about'];
  ";  
  ?&gt;
  </code></pre>
  
  <p>any help with this project would help us greatly and thanks!</p>
  
  <p>(update)
  This is the jquery that i tried to use but it went to the url and i think that is not very safe</p>
  
  <pre><code>    $(document).ready(function(){
      $("#chat").click(function(){
          $("#content").load("a.php");
      });
  
  
      $("#send").ajaxSubmit({url: 'a2.php', type: 'post'})
  
      });
  </code></pre>