I'm writing a series of web pages in which I want to modify the format in which a time-of-day is displayed. I've written a PHP function to do that, and the function works perfectly when the it is in the same file as the rest of the code. However, I want to do this conversion process in several related files, so I"d like to put the function in an external file that I can simply "include" where needed. TBut I can't get tghe "include" bit to work.
Here's the code I'm using for the inclusion process:
"[07-Jul-2016 11:12:03] PHP Warning: include() [function.include]: Failed opening
'http://www.northcentralflaa.org/d.sysadmin/f-time.php' for inclusion
/home1/northce1/public_html/d.sysadmin/admin-portal.php on line 19"
<!--#include file="http://www.northcentralflaa.org/d.sysadmin/f-time.php" -->
echo "The file was imported";
I found a fix. I cannot fully understand why it works, but if I re-write that second include commend as
include $_SERVER['DOCUMENT_ROOT'] . '/d.attic/f-time.php';
it works as expected. (The re-write was NOT required of the first include statement, which leaves me mystified.)