note 75434 deleted from function.include by tularis

From: Date: Wed, 30 May 2007 12:15:29 +0000
Subject: note 75434 deleted from function.include by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127028@lists.php.net to get a copy of this message
Note Submitter: cmedina at bluecorestudio dot com Reason: useless ---- A small fix to code of nested includes I added before... When the var $FILE_PATH is used in different nested includes, the $FILE_PATH is replaced within each include, and can cause an error (because a second level include replaces the path of the first level includes and third replaces second's and so on), so to avoid this you should use unique varnames for each path. This could be easily resolved by replacing the var $FILE_PATH with something like this: <? ${"C".sha1(__FILE__)} = ... ?> where "C" is to avoid the varname to start with a number (which would cause an error). Also, unique varnames by hand can be used to avoid consecutive calls to sha1, but in my case I prefer the hash var method. Use what best fits to your needs.

« previous php.notes (#127028) next »