RE: [PHP] preventing multiple includes

From: Date: Sun, 23 Jul 2000 02:16:29 +0000
Subject: RE: [PHP] preventing multiple includes
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7746@lists.php.net to get a copy of this message
There is also the defined() & define() functions... i.e. <? if ( !defined('__MYLIB_INC__') ) { define('__MYLIB_INC__', 1); .... } Regards Matthew Clark. >-----Original Message----- >From: Hans H. Anderson [mailto:me@hansanderson.com] >Sent: 19 July 2000 10:21 PM >To: Mark Roedel >Cc: Angus Mackay; php-general@lists.php.net >Subject: RE: [PHP] preventing multiple includes > > >I usually just do something like this: > ><?php if(!isset($headerincluded)) { ?> > ><html><head> blah, blah. > ></head> ><body> > ><?php > $headerincluded = 1; > } > ?> > >Then if I screw up and include it twice, it just ignores it after the >first time. > >Hans > >On Wed, 19 Jul 2000, Mark Roedel wrote: > >> > -----Original Message----- >> > From: Angus Mackay [mailto:amackay@gusnet.cx] >> > Sent: Wednesday, July 19, 2000 2:37 PM >> > To: php-general@lists.php.net >> > Subject: [PHP] preventing multiple includes >> > >> > >> > what is the best solution for preventing multiple includes? >> >> It doesn't seem to be documented in the manual yet, but the >include_once() >> function mentioned in the changelog seems like it might be kinda >> promising... >> >> >> --- >> Mark Roedel | "Blessed is he who has learned to laugh >> Systems Programmer | at himself, for he shall never cease >> LeTourneau University | to be entertained." >> Longview, Texas, USA | -- John Powell >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >> For additional commands, e-mail: php-general-help@lists.php.net >> To contact the list administrators, e-mail: php-list-admin@lists.php.net >> >> >> > >Hans Anderson ~ me@hansanderson.com >PO Box 426, Missoula, MT 59806 | PHP, Search Engines, SQL > (800)397-9116 / (406)549-6524 | Databases, Flash Multimedia, > http://www.hansanderson.com | Killer Audio Production, > http://www.goofiness.com | Minty Fresh Breath. > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#7746) next »