我想点击一个按钮,它会将变量(cat list.txt)的输出发送到textarea。实际上,我将有3个按钮。
<?php
$output = shell_exec('cat LIST.txt');
?>
<!DOCTYPE html>
<html>
<body>
<br>
<textarea placeholder="List Status" name="List" rows="30" cols="100" id="myTextarea"></textarea>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("myTextarea").value = "<?php echo "<pre>$output</pre>";?>";
}
</script>
</body>
</html>