how do I return to a different directory in PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mathanan
    New Member
    • Feb 2010
    • 12

    how do I return to a different directory in PHP

    I am writing a script that uses different directories to get php files and html files.

    directory structure looks like this

    /includes (directory to php files)
    /secure (directory to HTML files)
    / (root directory to index.php)

    I have been looking at the $_SYSTEM['DOCUMENT_ROOT'] and trying to get it to return the / directory, but it ends up going to the httpd/PRIMARY directory which is not in the same website that I am working on. I am lost. .. lol

    this is the code I have been trying. . .that does not work.
    Code:
    $level_page = ($_SERVER['DOCUMENT_ROOT']."/secure/level1.html");
  • Mathanan
    New Member
    • Feb 2010
    • 12

    #2
    Oh, I am using SME 7.4 server and PHP 4.3

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      Try the dot-slash directory prefix (./). That resolves to the root directory execution started in.

      Comment

      • Mathanan
        New Member
        • Feb 2010
        • 12

        #4
        what syntax would I use to put that in?

        chdir("./") ?

        Comment

        • Mathanan
          New Member
          • Feb 2010
          • 12

          #5
          ok that is fixed. ...lol...

          Thank you Markus for that info. . . .sent me in the right direction.

          Comment

          Working...