I have a really strange problem. I am redeveloping a web site and am trying to organise my PHP code in the best possible way.
I have a common file which includes my custom functions for the site and am using require_once() in my scripts to include these functions where needed.
Because of my directory structure I need to occassionally use an absolute URL to call the common file, however when I do this, things don't work.
For example, this works....
require_once('../site_functions/html_fn.php');
but this doesn't...
require_once('http://www.myurl.com/site_functions/html_fn.php');
When I say it doesn't work what I mean is, I get the fatal error message, "Call to undefined function etc." even though the function is defined in html_fn.php
To try and troubleshoot this, I put, echo "test message"; in html_fn.php and this script is called OK both with the relative and absolute URL's.
However, there's obviously something going wrong with the function call as this will only work with the relative URL.
Could anyone please offer an explanation?!?
Thanks