When including other files in your PHP scripts, what is faster for webserver to process:
include 'http://www.mydomain.com/bin/scripts/thescript.php';
OR
include '/home/user/public_html/bin/scripts/thescript.php';
OR
include '../../scripts/thescript.php';
OR is there really no practical difference in the real world?
This is not an academic question. If all three methods are equally satisfactory in real time, please tell me. That’s all I need to know.
Absolute, i.e. strating with “/” is always better. That way if you move your app you don’t have to manually update the path names. I use a combo of 2 functions to define the absolute path as a constant.
I am using inc/ in my example, but you can change this. This will allow you to just use the constant ROOTPATH rather than trying to figure out the path evertime.
Another way is like this…
Just include the file with these defines in your template page.