The status is fine 200 but then the data is null here is my codes: in my controller
var link = 'http://127.0.0.1/mobile/subject.php';
var userid = localStorage.getItem('loginDetails');
console.log(userid);
$http.post(link, {userid}).then(function(res){
console.log(res);
})
in my php code. require_once('connection.php');
$post_data = file_get_contents('php://input');
$request = json_decode($post_data);
$userid = $request->userid;
$subject_sql ="SELECT SubjectName FROM subjects WHERE userid = '"
.$userid. "' ";
$result = $con->query($subject_sql);
$re=$result->fetch_assoc();
echo json_encode($re);
?>
Here guys i put my localstorage value in a variable "userid" because i want to use my localstorage value in my php code. Is their something wrong with my codes specially in my controller?