|
Posted by Dikkie Dik on 01/26/07 09:52
> I was toying with trying to find a way whereby I could have a single
> PHP file, and then specify whether to either see the processed output
> or the source code by using the extensions php and phps (respectively).
>
> So, with one file called "theFile.php" on the server, going to
> "www.server.com/theFile.php" would show the end result of the php
> actions, whereas going to "www.server.com/theFile.phps" would show the
> actual content of the file itself.
I would do this in another way: create a PHP script that takes a
filename as a parameter, checks this to see if it is a file that is
allowed to be seen, and sends the contents of the file as plaintext to
the browser.
You would call it with something like
www.server.com/showsource?file=theFile.php
Of course, you can instruct apache to turn that into any other URL with
rewriting.
Best regards
Navigation:
[Reply to this message]
|