home_directory; $folder = $_POST["folder"]; $filename = $_POST["filename"]; $dir = get_directory($folder, $user); if (!$dir) { error_log("i/php/readfile.php - invalid directory"); http_response_code(409); exit(0); } $contents_of_dir = $database->get_links_of($dir); $file_node = null; foreach ($contents_of_dir as $c) { if ($c['name'] == $filename) { $file_node = $c; } } var_error_log($file_node);