Web Analytics Made Easy -
StatCounter specifying path relative to root - CodingForum

Announcement

Collapse
No announcement yet.

specifying path relative to root

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • specifying path relative to root

    I'm trying to include a file using the path relative to the root rather than relative to the file
    in asp (and html) I would specify the path as
    Code:
     "/includes/file.inc"
    and no matter where the location of the file I put that code in it would always find the right page... however when I do the same in php it doesnt work, I have to give the relative path... how can I change this?
    http://www.hazelryan.co.uk

  • #2
    PHP Code:
    include($_SERVER['DOCUMENT_ROOT'] . '/includes/file.inc'); 

    Comment


    • #3
      iirc $_SERVER['DOCUMENT_ROOT'] doesnt work on IIS
      http://www.hazelryan.co.uk

      Comment


      • #4
        realpath()?
        I'm not sure if this was any help, but I hope it didn't make you stupider.

        Experience is something you get just after you really need it.
        PHP Installation Guide Feedback welcome.

        Comment

        Working...
        X