RE: [PHP] HOWTO read PHP source code into a textarea
| From: | Mikey | Date: | Fri, 25 Feb 2005 17:29:30 +0000 |
| Subject: | RE: [PHP] HOWTO read PHP source code into a textarea | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-209401@lists.php.net to get a copy of this message | ||
> I have a file 'nav.php', whose source code I want to load
> into the textarea on page 'aaa.php', so the source can be
> edited and changed.
>
> Is there a resource that I can read to help me do this?
If you want to render HTML into a textarea then I am afraid you are on a
hiding to nothing - the only thing a textarea can render (on all platforms)
is text. So in that regard you may wish to jus modify your code that
aaa.php becomes a function that returns a string that you can set as the
value like so:
<textarea name="test"><? echo $some_text; ?></textarea>
There is a prject called htmlAreas which allows for rendering of HTML in a
textarea but it only works on IE: http://www.interactivetools.com/ but
again, this would require the same kind of modification as above.
Another solution would be to use an <iframe src="aaa.php"> tag...
HTH,
Mikey