Log file for {$_POST['logDay']}:
"; echo "File path: $fileName
"; // execute a command in the shell: sudo sh get-logs.sh if (file_exists($fileName)) { $fileContents = file_get_contents($fileName); echo "" . htmlspecialchars($fileContents) . ""; } else { echo "Log file for " . $_POST['logDay'] . " does not exist."; } } ?>