On Tuesday 07 November 2006 21:50, Nuno Vaz Oliveira wrote:

> because INCLUDE\SESSION.PHP is going to be included in INDEX.PHP witch is
> NOT in the same directory of DATABASE.PHP?
>
>
> In other words... When PHP processes an include statement does it include
> the file where the include statement is and then process its contents
> (eventualy including other files) or does PHP processes the file to be
> included and only includes it after that?

When PHP hits an include() (or require(), or include_once(), etc.), it copies 
the contents of the included file into the running context and executes it.  
That process is recursive.  

All include statements are parsed based on the defined include path, where "." 
is interpreted relative to the active context, vis, the script that the web 
server itself is running.  

That means that if the include path contains ".", and apache executes a.php, 
and a.php includes "foo/b.php", and b.php includes "c.php", then "c.php" is 
looked up on the file system as "./c.php", relative to a.php, since that's 
what apache is actually running.  

Got that? :-)

-- 
Larry Garfield                  AIM: LOLG42
[EMAIL PROTECTED]               ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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

Reply via email to