note 44341 deleted from function.include-once by aidan

From: Date: Sat, 21 Aug 2004 07:21:36 +0000
Subject: note 44341 deleted from function.include-once by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-75047@lists.php.net to get a copy of this message
Note Submitter: jellieness at hotmail dot com ---- Besides being case-insensitive, PHP will not recognize the same include if the relative path is different ... for example: page1 sees that a user is not logged in and calls login page for the user to login. Once the user has completed the login form, the login page checks the database then includes page1 (where the user originally wanted to go). Both page1 and the login-processor need access to an include file which has db type functions in it. If the include path for one looks like: include_once("dbmodules.php"); and the other looks like: include_once("../functions/dbmodules.php"); the "dbmodules.php" file will be included twice and you'll get: Fatal error: Cannot redeclare ... (name of first function in file)

« previous php.notes (#75047) next »