ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-install
php-install
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved