Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    25
    Thanks
    4
    Thanked 1 Time in 1 Post

    best way to get installed directory

    Hi all,

    I'm trying to build a project that I plan on making installable in the future, what i'm trying to do is find a way to get the directory that the app is installed in, I have a config page created and would like to set a variable in there that would store the apps root directory.

    So lets say for example I want to include an image instead of writing the full value manually I want to be able to put $variable/images/image.png or something similar.

    Thanks in advance

  • #2
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    335
    Thanks
    2
    Thanked 49 Times in 48 Posts
    PHP has a host of native directory functions for that. They are used by installable CMS' such as Wordpress...getcwd() will get the current directory of the script.

    Check out http://php.net/manual/en/ref.dir.php for more directory functions


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •