|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-02-20 20:23 UTC] khaos337 at gmail dot com
[2012-02-20 20:26 UTC] rasmus@php.net
[2012-02-20 20:26 UTC] rasmus@php.net
-Status: Open
+Status: Feedback
[2012-02-20 20:30 UTC] khaos337 at gmail dot com
-Status: Feedback
+Status: Open
[2012-02-20 20:30 UTC] khaos337 at gmail dot com
[2012-02-20 20:34 UTC] rasmus@php.net
[2012-02-20 20:34 UTC] rasmus@php.net
-Status: Open
+Status: Not a bug
[2012-02-20 20:39 UTC] khaos337 at gmail dot com
[2012-02-20 20:44 UTC] rasmus@php.net
[2012-02-20 21:52 UTC] khaos337 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 05 18:00:01 2025 UTC |
Description: ------------ Pages that are loaded with auto_prepend_file and auto_append_file load multiple times per page request if there is no favicon.ico located in the root directory. I believe this only happens with chrome and IE, have not been able to replicate the issue with firefox. You will see using this configuration, if you load index.php your database will get at least 2 entries, one for '/index.php', and one for and one for '/favicon.ico/' This might just be a matter of appending the documentation if this is deemed "not a bug" because according the php.net manual auto_prepend_file and auto_append_file should function exactly as the require() function. However if this code was put in index.php as "require('prepend.php')" instead of being autoloaded it would always only load once. Test script: --------------- .htaccess: php_value auto_prepend_file /path_to_file/prepend.php prepend.php: <?php $mysqli = new mysqli('localhost', 'user', 'pass', 'database'); $mysqli->query("INSERT INTO uri_test (uri, time) VALUES ('$_SERVER[REQUEST_URI]',now())"); ?> Expected result: ---------------- expected result is that the prepend.php file only runs once per page load. Actual result: -------------- prepend.php loads when the browser is seemingly requesting the URI for the favicon.ico