note 64461 deleted from function.highlight-file by bjori

From: Date: Fri, 14 Apr 2006 22:20:05 +0000
Subject: note 64461 deleted from function.highlight-file by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-108119@lists.php.net to get a copy of this message
Note Submitter: gmail@diogo86 Reason: bad code ---- I have a directory for some script testing and it is pretty useful to have its source code shown at runtime. Then I made this: append.php <?php echo "<hr />"; echo "<code><strong>Source code of {$_SERVER['PHP_SELF']}</strong></code>"; echo " (<a href=\\"http://my.external.url{$_SERVER['REQUEST_URI']}\\">link</a>) <br />"; highlight_file($_SERVER['SCRIPT_FILENAME']); ?> And configured the .htaccess for this directory: php_value auto_append_file "/home/diogo86/public_html/testing/append.php" If for some reason a script can't have its source appended (such as a xml output) you can call exit() at the end of your script to ensure the file won't be included.

« previous php.notes (#108119) next »