I am working on a site in which i need it to print text from a file to a form. Right now i am using the include function. Main problem with this is, I want the ability to edit php code in the box, and with include, and the code is processed. I am wondering if there is a way to print the text from a file, ignoring all php code so I get the whole thing in the text area.
Thanks
Not processing php
Started by thomas123, Dec 15 2008 02:16 AM
3 replies to this topic
#1
Posted 15 December 2008 - 02:16 AM
|
|
|
#2
Posted 15 December 2008 - 11:35 AM
I'm not sure I understand right - but basically, you want to load some text from a file and print it in a <textarea>, without the server parsing your PHP - in other words, you want to be able to actually see the PHP code from the file in the browser?
#3
Posted 15 December 2008 - 08:50 PM
#4
Guest_Jaan_*
Posted 15 December 2008 - 10:26 PM
Guest_Jaan_*
I used this method in my File Manager:
$open = fopen("files/".$filename.".txt", "r");
$size = filesize("files/".$filename.".txt");
$read = fread($open, $size);
echo "<form action='?do=update&file=$file' method='post'>
<table align='center' width='640' border='0'>
<tr>
<td> <font id='base-text'>File name:</font> $file</td>
</tr>
<tr>
<td<textarea cols='100' rows='20' name='content'>$read</textarea></td>
</tr>
<tr>
<td><input type='submit' value='Update'></form></td>
</tr>
</table>
</form>";


Sign In
Create Account

Back to top









