Reply to Re: Also... Re: PHP includes question

Your name:

Reply:


Posted by Curtis on 02/01/07 08:30

On Thu, 01 Feb 2007 00:22:27 -0800, Nu <no@spam.com> wrote:

>
> "Sanders Kaufman" <bucky@kaufman.net> wrote in message
> news:Klgwh.2288$4H1.1860@newssvr17.news.prodigy.net...
>> Nu wrote:
>>
>> > Also, does it matter if I put "require_once" lower down in the code
> after
>> > some other code my abort it?
>>
>> No - and you may find this weird.
>> An include/require will be included no matter what.
>>
>> For example:
>> <? php
>> if(TRUE){
>> include "myfile.php";
>> } else {
>> include "yourfile.php";
>> }
>> ?>
>>
>> In the above example - BOTH files will be included no matter what.
>
>
>
> I have seen code like this:
>
> if ( file_exists( "$IP/languages/classes/$class.deps.php" ) ) {
> include_once("$IP/languages/classes/$class.deps.php");
> }
>
>
> It appears not to load the file unless an if statement passes.
>
>

It can't include a file that doesn't exist, it's not because it's in an if
statement, it's what the if statement checks.

--
Curtis, http://dyersweb.com

[Back to original 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

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