$meta['time'] = time(); $meta['type'] = '/profile/'; $meta['status'] = 0; //Add the meta $response['meta'] = $meta; //Ensure the user is logged in session_start(); if(!isset($_SESSION['userID'])) { //Send the response $response['data']['reason'] = "The user is not logged in."; sendResponse(400, json_encode($response)); return false; } //Get the current user $User = new User($_SESSION['userID']); $description = $_POST['description']; $description_response = $User -> change_description($description); //Set the status to 1 (success) $response['meta']['status'] = (int)$description_response[0]['status']; //Send the response sendResponse(200, json_encode($response)); return true; ?>