Should I include locally or remotely?

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2010-04-26T14:50:56Z Indexed on 2010/04/26 14:53 UTC
Read the original article Hit count: 119

Filed under:
|

Just something I wonder about when including files:

Say I want to include a file, or link to it. Should I just for example:

include("../localfile.php");

or should I instead use

include("http://sameserver.com/but/adirect/linkto/localfile.php");

Is one better than the other? Or more secure? Or is it just personal preference?

Clearly it would be a necessity if you had a file that you would include into files in multiple directories, and THAT file includes a different file, or is there some other way of doing that?

© Stack Overflow or respective owner

Related posts about php

Related posts about include-path