PHP output into HTML:
<textarea><?php echo shell_exec('/etc/init.d/iptables status'); ?></textarea>
PHP output into HTML, but in form of a Javascript Value Update on the Textarea element:
<textarea id="txtArea">...</a>
<script>
document.getElementById("txtArea").value = "<?php echo shell_exec('/etc/init.d/iptables status'); ?>";
</script>
But i doubt, that you want this.
So, finally the whole thingy again, but now with a button as the trigger for a JS/jQuery Ajax Get request:
<textarea id="txtArea">...</a>
<input type="button" id="txtAreaUpdateButton" value="Update Textarea"/>
<script>
$(document).ready(function() {
$('#txtAreaUpdateButton').click(function() {
$.ajax({
type: "GET",
url: "http://www.yoursite.com/request.php",//get response from this file
success: function(response){
$("textarea#txtArea").val(response); // update textarea with response
}
});
});
});
</script>
Here 'request.php' contains:
<?php echo shell_exec('/etc/init.d/iptables status'); ?>
Keep an eye on the quotes. They are often the source for errors.