Three days had passed and still having problems to get this things work. This AJAX Call on my js file seems working when it comes to sending JSON data:
var
instead of this
data: "{'lastName':'" + _lname + "','firstName':'" + _fname +
"','middleName':'" + _mname + "'}",
use this
data: {lastName:_lname,firstName:_fname,middleName:_mname},
Can you see the ajax request data using the firebug console?
You cannot get the lastname, firstname from $_POST. It's inside the json string. First, you have to get the data using
$data = $_POST['data'] or $_REQUEST['data']
Then, decode the $data using json_deocde and access your attributes.
json_decode($data);
$post = file_get_contents('php://input');