"Sims" <si*********@hotmail.com> wrote in message
news:c2*************@ID-162430.news.uni-berlin.de...
if you use requre or include _once() then they should never be included
again.
I do not know if there is a way to check, but years ago, in C i would write a constant in the include file and check if it was defined in the
include if not, would include itself, then define.
What about
if( !defined('INCLUDE_THEFILE'))
{
include( 'somefile.php' );
}else{
echo 'Already included'
}
...
...
// in somefile.php
defined('INCLUDE_THEFILE')
Might not be the best way...i didn't know that including a file more than
once could be a prob.
Sims
Yea thats it, then I started thinking, they should just use require/include
...._once(); then it hit me, instead of going through all the code, and
writing snippets to see if it was already include, just change all includes
to .._once().
OK, as I write this, I just got an idea, perhaps a small file that shows
something cool is included at several places, and they dont want to over do
it, so they need to check if it is included.
--
Mike Bradley
http://www.gzentools.com -- free online php tools