I am posting JavaScript objects to my PHP backend but I am not able to retrieve the data.
I posted this java-script object:
{"name":"Mastermold"}
I am trying to access name like this:
$name= $_POST["name"];
The error is:
{"error":{"type":"ErrorException","message":"Undefined index: name","file":"C:\Program Files (x86)\Ampps\www\app\controllers\JournalsController.php","line":34}}
saveMongoJournal=function(theJournal,doThis) {
journalRoute="http://localhost/public/journals"
$http.post(journalRoute,theJournal).success(doThis);
};
$scope.clicky= function(){
saveMongoJournal( {name: "mastermold"},alertReply);
};
$_POST['name'];