I have this code right here:
$('#add_club_button').click(function(){
$('#add_club_button_ajax').show();
$.post('<?php echo base_url()?>addClub/save',$('#add_club_form').serialize(),function(data){
if(data == 'OK'){
//refresh
$('#add_club_button_ajax').click(function() {
location.reload();
});
$.unblockUI(); //unblock
$('#add_club_button_ajax').hide();
}
//c(data);
});
});
What I want is to store the data I get from POST (e.g. id and name) to the database. My problem is that I don’t know how to get the data I get from POST.
If you plan to store to a server-side database, you need to use a server side language like PHP to accept your HTML POST variables, prepare them, and process them to the database.
Submit your HTML form to a php script containing something like my example above. There is no real need to use jQuery unless you are using it for other reasons than just submitting a form.