#1
  1. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Location
    Mohali
    Posts
    5
    Rep Power
    0

    If no file path is given in include() function


    What happens if no file path is given in include() function?
  2. #2
  3. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,095
    Rep Power
    1990
    It will attempt to include the file relative to the current executing script (tip: it may not be the file that is calling the include() function).
  4. #3
  5. DEVILS IN RED
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2005
    Location
    Kerala, India
    Posts
    200
    Rep Power
    10
    from the documentation:

    Files are included based on the file path given or, if none is given, the include_path specified. If the file isn't found in the include_path, include will finally check in the calling script's own directory and the current working directory before failing. The include construct will emit a warning if it cannot find a file; this is different behavior from require, which will emit a fatal error.

    If a path is defined whether absolute (starting with a drive letter or \ on Windows, or / on Unix/Linux systems) or relative to the current directory (starting with . or ..) the include_path will be ignored altogether. For example, if a filename begins with ../, the parser will look in the parent directory to find the requested file.
    Ahmed Shefeer

IMN logo majestic logo threadwatch logo seochat tools logo