In this code, when you click on a file link, it sends a GET request to index.php with the file name as a parameter. The index.php script then checks if the file exists and reads its contents using file_get_contents. If the file exists, it outputs the contents as text. If the file does not exist, it outputs an error message.
You can copy this code into your HTML file and adjust it as needed.