Re: Invoking functions stored in a separate directory?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 22 Aug 2009 20:37:17 +0930, robleyd@xxxxxxxxxxx (David Robley) wrote:

>Clancy wrote:
>
>> $ok = include (HOST_PATH.'/Halla.php');
>
>Because you are assigning the result of the include to a variable. Try 
>
>include (HOST_PATH.'/Halla.php');
>
>and it will work as you expect. And similarly for 
>
>define ('HOST_PATH','../Engine');

Thanks. But no; that's not the answer.  'Include', like any other function, returns a
result; true if the operation was successful, and false if it failed. I was using this to
verify that the 'include' operation had been successful.

The more I thought about it last night, the more dissatisfied I became with the notions
that 'include' could work differently in different circumstances, and also that defining a
path could alter the way it worked.

I did some more tests this morning, and eventually established that my confusion was the
result of two different effects.

The first was that I find the PHP syntax rather picky,  and I rely on error messages to
alert me to my frequent errors, but apparently all error messages are turned off on the
remote system, and if anything is wrong all I get is a blank screen.

The second is that although I use Dreamweaver as an editor, and it has moderately good
colour coding which indicate most errors, I am partially red green colour blind and tend
not to notice the erroneous colours.

I repeated my tests this morning and eventually managed to establish that

	i. there is no difference in the behaviour of include between the local and remote
systems, and

	ii. contrary to Arno's advice, include ../Engine/Main_prog.php; works just the
same as include ENGINEPATH."Main_prog.php";

So now I can get on with uploading my program!

Thanks,

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux