You are here: Re: Single PHP file - *.php = process, *.phps = source. « PHP Programming Language « IT news, forums, messages
Re: Single PHP file - *.php = process, *.phps = source.

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация