You are here: Re: Parsing a php include (which also contains php code) - or "Reparsing" « All PHP « IT news, forums, messages
Re: Parsing a php include (which also contains php code) - or "Reparsing"

Posted by Tom on 06/20/07 17:35

On Wed, 20 Jun 2007 06:40:27 +0200, J.O. Aho wrote...
>
>Steven Borrelli wrote:
>> Hello,
>>
>> I am using the <?php include() ?> statement on my website for
>> organizational purposes. However, one of my includes contains some
>> PHP code. Is there any way for the server to actually parse the
>> include? I've tried this before, and it did not parse the include.
>> Rather, it included the file as just plain ASCII.
>
>If the main page is a php file, include will also make the included page to be
>parsed by php.
>
>
>I do suggest you use semicolon after each command, no matter if it's alone
>between the php-tags or not.
>
>
>It's always better to use .php as the file extension on the included files
>too, this as .inc normally don't be set in the server to be parsed, which
>leads to that if a person gives and url like
>
>http://example.net/footer.inc
>
>they will see the full source, and if you happen to have your database
>login/password stored in the file, then they will know how to access it.
>
>
>If you don't already, it's quite good to run apache web server and avoid iss.
>

I've run 3rd party programs the use .inc and .php files in their includes and
haven't had a problem with either. As you mentioned, if the initial file is
..php, the rest should take care of itself.

I wonder if you could rename the inc file to a php file extension, and see how
it loads by itself. That might give a clue.

Tom
--
Newsguy.com
90+ Days Retention
Free SSL Connections
Create Your Own NZB Files

 

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

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