[PHP-INST] problem solved
by Erik other posts by this author
Aug 13 2002 5:03PM messages near this date
Re: [PHP-INST] php 4.2.2 + apache2.0.40
|
[PHP-INST] Conflict with Frontpage Server Extension 2002?
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
--
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
|