sammy
sammy

Reputation: 717

send information via form without transaction in another page PHP

as i told, i need a form that send some information to another page but do not go to action page. is it possible? a form is like this:

<form name="form2" method="post" action="send.php"> 
<input type='text' name='name' id='name' value='ali'/>
<input type='text' name='id' id='id' value='123'/>
<input type='text' name='family' id='family' value='ali'/>
</form>

i want when i click on button, just send information. is it possible or needs to use of session?

Upvotes: 0

Views: 32

Answers (1)

Nere
Nere

Reputation: 4097

Use ajax:

var name   = $('#name').val();
var id     = $('#id').val();
var family = $('#family').val();
$.ajax({
    url : 'send.php',
    type : 'post',
    data : {name:'name',id:'id',family:'family'}
});

Upvotes: 2

Related Questions