Is it better to use the full path when including or requiring a file? Or is it just okay to use something like this include('../../file.php')?
And is it safe to include something like this include('www.website.com/fileToInclude/file.php')?
File Path
Moderator: General Moderators
Re: File Path
Using relative paths is a bad idea. Including from a website is a horrible idea.
Code: Select all
include $_SERVER["DOCUMENT_ROOT"] . "/path/to/file.php";