User has html-form, then user fills all field and data transferred to PHP script. How do wo开发者_Go百科uld data send, but not refresh html page?
If you don't want the page to be refreshed and submit data, you will have to use the ajax for that, have a look at its tutorial at w3school.com
Sounds like an AJAX solution. Quick google search
If you want to send the data without refreshing the page, you'll want to do an ajax submit. The easiest way to do this is via the jQuery AJAX Library. A quick example could be:
//example from the jQuery API docs.
$.ajax({
type: "POST",
url: "some.php",
data: $("#form_to_submit").serialize(),
success: function(msg){
alert( "Data Saved: " + msg );
}
});
精彩评论