I want to write text from highlight_file to the html textarea… but not sure how?
Note: I am able to write the screen the colored text, but I want it loaded into a box where I can modify the text. thx
<?php
...
$code = highlight_file($_POST[filename]);//not sure if this works to write to $code
...
?>
<html>
<textarea type="text" name="code" rows="40" cols="120">
<?php echo $code; ?>
</textarea> <!this does not work>
</html>
From the PHP docs:
So, use
$code = highlight_file($_POST['filename'], true);As a side-note: You do realize that this allows anyone with access to that script to read the code of all your files (PHP and other)? This includes any config files etc. which might contain database passwords.