PHP include() issues

  • IcyDragoon
  • Student
  • Student
  • IcyDragoon
  • Posts: 65

Post 3+ Months Ago

Let's say I want to know if the file is already included or not,
what are my options?

I do not want to use the include_once() or require_once()*

hmmm ..... I know maybe I define() a CONSTANT in the included file and check
if that CONSTANT with defined()?

any other alternatives? better ones?

if the file is included, then do this and this
if not then do that and that..
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

IcyDragoon wrote:
hmmm ..... I know maybe I define() a CONSTANT in the included file and check
if that CONSTANT with defined()?

That would be the easiest way. I believe phpBB uses this technique to prevent access to non-executable scripts (config files, etc).
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

http://www.php.net/get_included_files

Most people browse the net looking for porn, I browse the PHP manual looking for obscure function names to memorize.
  • IcyDragoon
  • Student
  • Student
  • IcyDragoon
  • Posts: 65

Post 3+ Months Ago

hmmmm I see.

I'll give it a try ^^

thanks.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 109 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.