Bug #14341 Updated: include() html vs file system - variable scope
| From: | timneill at hotmail dot com | Date: | Tue, 04 Dec 2001 21:19:16 +0000 |
| Subject: | Bug #14341 Updated: include() html vs file system - variable scope | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-72512@lists.php.net to get a copy of this message | ||
ID: 14341
User updated by: timneill@hotmail.com
Reported By: timneill@hotmail.com
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: FreeBSD
PHP Version: 4.1.0
New Comment:
nope the missing quote is not it - that is simply a typo on my behalf.
also the summary should read:
include() http vs file system - variable scope
Previous Comments:
------------------------------------------------------------------------
[2001-12-04 16:15:41] hholzgra@php.net
due to the missing 2nd quote i guess that you do not
include
"/includes/inc_file
but some php file with extension .php?
and shell9.vhosting.com is most likely configured
to parse and execute .php files?
so it deliveres
only the *results* of executing the files in a
subrequest and not the verabtim content of the
requested files
try to rename your include files to something
like .txt or .inc or whatever your server will
deliver 'as is' and everything will work fine
------------------------------------------------------------------------
[2001-12-04 14:45:30] timneill@hotmail.com
hi,
i have discovered a bug relating to the scope of variables surrounding and within include
files.
when i was using a http path for an include command, the include file could only see
variables instantiated within the include file. all variables instantiated within the
include could not be seen by the page calling the include.
however this was not the case when i used a relative path or absolute path using the file
system. for example:
$rootFile = "/accounts/www73038/www/www.art-co-op.net/html";
$rootDir = "http://shell9.vhosting.com/www73038";
include(../../includes/inc_file); //-- works
include($rootFile. "/includes/inc_file); //-- works
include($rootHttp. "/includes/inc_file); //-- fails
i'm not sure whether this is by design (i'm new to php & in the process of reforming
my evil microsoft ways). and i could not find mention of it in the documentation.
if you would like to find more information regarding my server and environment:
http://shell9.vhosting.com/www73038/phpinfo.php
thank you,
tim neill.
------------------------------------------------------------------------
[2001-12-04 14:32:41] timneill@hotmail.com
hi,
i have discovered a bug relating to the scope of variables surrounding and within include files.
when i was using a http path for an include command, the include file could only see variables
instantiated within the include file. all variables instantiated within the include could not be
seen by the page calling the include.
however this was not the case when i used a relative path or absolute path using the file system.
for example:
$rootFile = "/accounts/www73038/www/www.art-co-op.net/html";
$rootDir = "http://shell9.vhosting.com/www73038";
include(../../includes/inc_file); //-- works
include($rootFile. "/includes/inc_file); //-- works
include($rootHttp. "/includes/inc_file); //-- fails
i'm not sure whether this is by design (i'm new to php & in the process of reforming
my evil microsoft ways). and i could not find mention of it in the documentation.
if you would like to find more information regarding my server and environment:
http://shell9.vhosting.com/www73038/phpinfo.php
thank you,
tim neill.
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14341&edit=1