php - read json object clean and sanitize for database storage -


hi need send json data php script , unpack, clean , sanitize insertion in database problem not know how data php script , read, says index undefined. ajax request looks like

$.ajax({         type: "post",         url: "save.php",         data:{param:my_people},          success: function(data){         //success here means ajax call succeeded, not data works     alert(data);     }     }); 

this php looks like

 $data = json_decode($_post['my_people']); 

the truth not know how work json ajax , php. highly welcome!

if variable my_people javasript valid,
$_post['param'] should contain my_people datas....

did try write
die(json_ecode($_post)); or die(json_ecode($_get));
in first line of save.php see coming ajax ?

aahh.. save.php file editing
, code using $.ajax on same directory ?


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -