You can try adding a new handler to 'take care' of .phps:

     Action show-code /whatever/sourcify.php
     AddHandler show-code .phps

The sourcify.php would be something like this:

<HTML>
  <HEAD>
    <TITLE>
      Source Display
    </TITLE>
  </HEAD>
  <BODY BGCOLOR="white">
<?php
  $script = getenv( "PATH_TRANSLATED" );
  if(!$script) {
    echo "<BR><B>ERROR: Script Name needed</B><BR>";
  } else {
    if (ereg("(\.php|\.phps|\.inc)$",$script)) {
      echo "<H1>Source of: $PATH_INFO</H1>\n<HR>\n";
      highlight_file($script);
    } else {
      echo "<H1>ERROR: Only PHP or include script names are allowed</H1>";
    }
  }
  echo "<HR>Processed: ".date("Y/M/d H:i:s",time());
?>
  </BODY>
</HTML>

For more information, check out 'Action' and 'AddHandler' on your Apache
documentation.

This has the advantage that you can add your own header/footer information
so that the page does not look so 'detached' from your site... In fact, this
is how I'm going to do it from now on!!

HTH,
  Fernando Madruga

-----Original Message-----
From: Anders Pettersson [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 19 de Março de 2001 18:12
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Showing source code with .phps extension


Thanks for your answer, but I don't run PHP as a module, but rather as CGI.

If I follow your advise, my phps files get parsed as usual, they don't show
the source code.

At the moment I'm solving it with the highlight() command, but that is not
an optimal solution...

Regards
Anders Pettersson



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to