HELP: How to get file directory?

Discussion in 'HTML & Website Design' started by irule272, May 21, 2009.

  1. #1
    Hello I have php files and I'm having problem getting the file directory of a php file. Seems like dreamweaver can't recognize php code on their auto-browse feature. I cant browse it but it gives me C://document....... etc but what I want is a ready made directory where I dont need to edit anything once I upload it on the webhost. I know this is very easy for all webmaster here.


    When the file is on the root folder I dont have problem getting the php directory for example

    <?php include("Divs/footer.php"); ?>

    Divs is the folder where I'm getting the php file.


    But when the file is in another folder I'm having problem getting the php file on the div folder.



    Anyone? Thanks!
     
    irule272, May 21, 2009 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php include $_SERVER['DOCUMENT_ROOT'].'/Divs/footer.php'; ?>

    Works on Apache servers, not IIS.
     
    Cash Nebula, May 22, 2009 IP