SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast Technographs's Avatar
    Join Date
    Jan 2009
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Indifferent path for file_exists

    Hi,

    I am using file_exists function however there is an problem with the path of the file to be checked. I have an file to check by this function in folder structre as demo/folder1/check.php which is working on another server from where i got the demo files. When i am using those demo files on my server i must have to give the full path of my server e.g. home/myserverusername/public_html/demo/folder1/check.php how can i avoid giving full path to the file. Is there any problem with the server settings.

    Please help

    Thanks

  2. #2
    SitePoint Zealot adam.jimenez's Avatar
    Join Date
    May 2009
    Location
    Ware, UK
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I used to have these sorts of issues with varying versions of PHP.
    Now I just do everything in relation to the file I'm working on.

    e.g.
    PHP Code:
    file_exists(dirname(__FILE__).'/../path/to/file.php'); 

  3. #3
    SitePoint Enthusiast Technographs's Avatar
    Join Date
    Jan 2009
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks adam,

    I will try and let you know.

    Thanks again.

  4. #4
    SitePoint Wizard
    Join Date
    Mar 2008
    Posts
    1,149
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What does this give you:
    PHP Code:
    <?php
    echo getcwd();


Bookmarks

Posting Permissions

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