Jump to content

Main folder base command..I can't think of what to call it


KingOfHeart

Recommended Posts

If I'm in a subfolder on my site how do I call a file from the base folder?

 

I'm in the folder "Scripts" for example and I want to call a function from the parent folder.

I know you could use "../" if I remember right, but I'm looking for a php function.

 

It would use scripts something like this...

 

include $basefunction . "/index.php"

I'm having a hard time understanding your question.

 

Typically you would define the base application directory. That way your paths and includes are always consistent. So instead of having random "../", "../../someotherdir/blah", etc spread out in your code, it would be more like $basedir/someotherdir/blah. $basedir would be the absolute path, not a relative one (../ is relative).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.