Jump to content

Not processing php

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
thomas123

thomas123

    Newbie

  • Members
  • Pip
  • 8 posts
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

#2
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
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?
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#3
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
you want to look into PHP: fopen - Manual

#4
Guest_Jaan_*

Guest_Jaan_*
  • Guests
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>";