I am writing a simple script that contains a form with a textarea, textbox and submit button. I want to write a system command in the textbox, click the submit button and have the output of the command display in the textbox. This is the code I have so far:
<?php
if ($_POST['submit']) {
$output = system($command);
}
?>
<html><head></head>
<title>Run a command and output to a text box</title>
<body>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<textarea name="display" cols=30 rows=15 value="output"></textarea></p>
Command: <input type=text width=40 name="command"></p>
<input type=submit name="submit" value=" Submit ">
</form>
</body></html>
Unfortunately, the output is displayed as text in the html portion of the form. I don't want this. I want to redirect the output to the textarea.
Is this possible? Am I just not that familiar with html or php? Could someone please help?