'User text saved successfully.']); } else { // Send an error response http_response_code(400); echo json_encode(['message' => 'Invalid request.']); } } else { // Send an error response if the user is not logged in http_response_code(403); echo json_encode(['message' => 'Access denied.']); } ?>