Results 1 to 5 of 5

Thread: Please help define root directory for php include in subdirectory!
      
   

  1. #1

    Question Please help define root directory for php include in subdirectory!

    Hello everyone; I am in desperate need of some help with this!

    I am constructing a website with css and php_includes. My problem is that I do not know how to reference the root directory (where the includes file is) from within a deep-rooted subdirectory.

    I know that I can reference a file in the root directory from "root/sub/file" by prefixing the includes path with "../", however how can I reference the root from "root/sub/sub/file"?

    I really would appreciate any help here as I have been searching the internet for an answer for the last three days!

    Thank you for your time,

    - Benjamin.

  2. #2
    Join Date
    Apr 2009
    Posts
    170

    Default Re: Please help define root directory for php include in subdirectory!

    Hi

    This is a theory ok? Seems to me that all you have to do is to www.domain.com/include. Looks like you have been in the guru level and forgot the basic level. However, as I said, this is theory.

    Cheers

    Millie
    www.subeagle.com

  3. #3
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: Please help define root directory for php include in subdirectory!

    Most VH servers are set NOT to allow URL includes. So the solution posted by millie won't work.

    You can reference your includes file as:

    /home/cpusername/public_html/includes_file.php if you are on a VH account .
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  4. #4
    Join Date
    Apr 2009
    Posts
    170

    Default Re: Please help define root directory for php include in subdirectory!

    Hi

    So, that means the include codes are in the include_file.php, right? But /home/cpusername/public_html/... would really say (in my case)
    /www.subeagle.com/mycpusername/pub... (with the www in front of subeagle), right NavalDesign?

    Thanks

    Millie
    www.subeagle.com

  5. #5
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,080

    Default Re: Please help define root directory for php include in subdirectory!

    So, that means the include codes are in the include_file.php, right?
    Correct, or whatever else the file to be included is called.


    But /home/cpusername/public_html/... would really say (in my case)
    /www.subeagle.com/mycpusername/pub... (with the www in front of subeagle
    No, i mean what i wrote: /home/cpusername/public_html/

    No www, no subeagle.com. Just replace the "mycpusername" with your real CP username.

    This is the path to your root folder.
    Of course this assumes that the file you need to include is in your root folder, as you posted above.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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