|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31405 auto_append_file unable to see global variables
Submitted: 2005-01-04 12:22 UTC Modified: 2005-01-13 01:00 UTC
From: php20050104 at webfreezer dot com Assigned:
Status: No Feedback Package: PHP options/info functions
PHP Version: 4.3.8 OS: SuSE Linux 8.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: php20050104 at webfreezer dot com
New email:
PHP Version: OS:


 [2005-01-04 12:22 UTC] php20050104 at webfreezer dot com
Setting the following option in a .htaccess file appends the given file to any php file except it is terminated by exit:

php_value   auto_append_file   append.php

However although the manual states that this is just like a simple include() this is not true.
An included file can see the global variables from the script it is included from. Using the auto_append_file option does not allow the appended script to see the global variables.

Using a normal include() works of course so there is not a problem with the visibility of variables in included files in general.

Reproduce code:
  $a="This should work!";
  $GLOBALS["b"]="This should also work!";
  echo "Script apage.php will finish now.<br>";

  echo "And I say: ".$a."<br>";
  echo "And also: ".$GLOBALS["b"]."<br>";

Expected result:
Script apage.php will finish now.<br>
And I say: This should work!<br>
And also: This should also work!<br>

Actual result:
Script apage.php will finish now.<br>
And I say: <br>
And also: <br>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-13 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Jun 03 21:03:40 2023 UTC