This is a discussion on Re: [PHP] Display HTML/PHP code on a web page within the PHP General forums, part of the PHP Programming Forums category; Don't really understand the problem but htmlspecialchars() will convert: <b>Justin & Co</b> into &...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Don't really understand the problem but htmlspecialchars() will convert:
<b>Justin & Co</b> into <b>Justin & Co</b> .... which will solve half your problem... not sure what to do with php code... perhaps the same thing... Or, you may want to look at show_source() and highlight_file() as well... Justin On Thursday, July 17, 2003, at 02:59 PM, Jason Paschal wrote: > I've googled for it, but nothing came up. How do I display code on a > page without it being executed? > i want the page to display HTML code as it would look if you typed it > into an editor (not encoded), and the code I want to display is being > spit out by PHP. Which functions should i look at? i can get it to > display with urlencode, but, of course, it's encoded. > Thank you, > Jason > > P.S. a bit more info: > I'm pulling a file from my site like this: $file = > file("http://..../file.php"); > it works fine, but i want to be able to print out lines that meet a > certain criteria, and that includes any of the html source that comes > along with it. > however, the the search script tries to execute the lines instead of > displaying them. > i don't want to write this to a file and then display as this is for > admin purposes and i want to be able to do quick scans from a browser, > and i want the matches to display underneath the search form, which I > can do, but I make a note of it because the page still has to react as > an html page (form submission). > this make any sense? > > __________________________________________________ _______________ > The new MSN 8: advanced junk mail protection and 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > --- > [This E-mail scanned for viruses] > > |