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!
HTML page 1 that will use jquery ajax to send data into the php page
<form>
Name:<input type='text' name='name'>
E-mail:<input type='text' name='email'>
Gender:<select name='gender'>
<option value='male'>male</option>
<option value='female'>female</option>
</select>
Message:<textarea name='about'></textarea>
</form>
PHP page 2 that would recieve the data from the page 1 form
<?php
echo "
$_POST['name'];
$_POST['email'];
$_POST['gender'];
$_POST['about'];
";
?>
any help with this project would help us greatly and thanks!
(update) This is the jquery that i tried to use but it went to the url and i think that is not very safe
$(document).ready(function(){
$("#chat").click(function(){
$("#content").load("a.php");
});
$("#send").ajaxSubmit({url: 'a2.php', type: 'post'})
});