I've got the following bit of code to work in showing the actual PHP file source
code, but it doesn't show include() or require() files and I'd like it to..

-------------- source.php --------------

if(strlen($php)>0){
  $php = $DOCUMENT_ROOT . $php;
  if (ereg("(\.php)$",$php) && !ereg("\/\.\.", $php)){
    require("head.php");
    echo "<font class=\"source\">\n\n";
    show_source("$php");
    echo "\n\n</font>\n";
    require("foot.php");
  }
  else{
    require("head.php");
    echo "<font class=\"s\">\n";
    echo "  There's been an error..\n";
    echo "</font>\n";
    require("foot.php");
  }
  exit;
}

----------------------------

I've checked the manual and google, but I'm not too sure the keywords I'd used
were correct as I didn't find any results.. I looked at highlight_file() but it
would seem to cause the same output as show_source() neglecting to include the
php code within head.php and foot.php..

Is there a function I'm missing that would somehow allow me to add the head.php
and foot.php code within the source code output page?  Will I need to add
something to the head.php and foot.php files to have them included?

I'm a bit of a php newbie, so sorry if my terminology isn't correct.. TIA..

Take care.. peace..
eriol


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to