problem solved

From: Date: Tue, 13 Aug 2002 17:03:45 +0000
Subject: problem solved
Groups: php.install 
Request: Send a blank email to php-install+get-8106@lists.php.net to get a copy of this message
hi, the problem i had is solved (syntaxt highligting) i solved it like this. <?php if(!isset($_REQUEST['noline'])) { $noline=true; } ob_start(); show_source('myfile.php'); $raw=ob_get_contents(); ob_end_clean(); $raw = explode ( '<br />', $raw ); // Insert the line number $ml = strlen ( count ( $raw ) ); for ( $i = 0; $i < count ( $raw ); $i++ ) { if ( !isset ( $noline ) ) { $gap = ( $ml - strlen ( $i ) ); $raw[$i] = "<FONT COLOR=#999999><CODE>[" . str_repeat(" ", $gap ) . $i . "]</CODE></FONT>" . $raw[$i] . "<BR />"; } else { $raw[$i] = "$raw[$i]<BR />"; } } // Convert back to a string $raw = implode ( '', $raw ); // Print source echo "<html>\n <body>\n$raw\n </body>\n</html>"; ?> this way only the file specified "myfile.php" in the above code fragment will be shown so no files with sensitive info for example MySQL passwords will be shown regards Erik

« previous php.install (#8106) next »