Re: Anyway to open a PHP file and view its code in the browser?

From: Date: Thu, 14 Feb 2002 20:50:30 +0000
Subject: Re: Anyway to open a PHP file and view its code in the browser?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-84819@lists.php.net to get a copy of this message
On Thursday, February 14, 2002, at 03:26 PM, Kevin Stone wrote:
How can I open a local PHP script and view its code to the browser? The Readfile() method appears to parse and execute the code. The Fopen() method appears to parse and then not execute the code, leaving a blank screen, or at the very least displaying any non-PHP text existing in the script. This is obviously rare question because I can't find any references on this list or on Usenet. Is there a trick to this? Or is it simply not possible.
This is just a guess, but have you tried this? $text = "/* "; $text .= readfile($fp); $text .= " */"; To comment the code? Just a guess. (And it would result in nested comments, not sure if that is a no-no for the parser or not). Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#84819) next »