Can anyone help please?
I'm trying to submit a php file, which will then echo the html output (browser view source) of the submitted php file.
The trouble is I can't get the html output inside the textarea (html source = when the $file is run > browser > view source.)
This is what I've come up with:
<form method="post" action="<?php echo $PHP_SELF;?>" enctype="multipart/form-data">
<input type="file" name="code" value="Upload" />
<input name="submit" type="submit" value="code" />
<br />
<?php
if (isset($_FILES['code'])) {
$file = file_get_contents($_FILES['code']['tmp_name']);
echo '<form>
<textarea style="width:100%; height:300px;">'.$file.'</textarea></form>';
}
?>
Cheers