Home PHP 'Call to undefined function' across two different includes?

# PHP 'Call to undefined function' across two different includes?

Cawley
1#
Cawley Published in 2017-09-14 10:03:34Z
 I've got four PHP files that will form a simple template for my website: - functions.php (with all of the main functions for the website - huge file) - index.php (the main template file I'll be using, that will bring together the other three documents) - header.php (header for the website) - footer.php (footer for the website - this is where the problem occurs) functions.php - a snippet. This function is simply on its own, not inside of a class or anything.   header.php - no relevant parts. But, I am able to use functions from the functions.php file fine from here. footer.php - relevant parts included. Error occurs here on line 27. echo '
•  This definitely works as I am calling other variables from functions.php, which are successful. Further down the file, I include first the header.php file, then the footer.php file in identical ways: require ($_SERVER['DOCUMENT_ROOT'] . "/" . "page/page-elements/header.php"); require ($_SERVER['DOCUMENT_ROOT'] . "/" . "page/page-elements/footer.php");  When the footer.php is included, and I load the webpage, I get the error message: Fatal error: Call to undefined function LandingPageURL() in C:\Hosting\website\httpdocs\page\page-elements\footer.php on line 27 Is it something that I'm doing wrong, calling a function from another file that is included into my main index.php file? I made sure to use 'require', so that I knew that functions.php was being pulled into the index.php.
• mracer164
2#
 The functipns.php file has to be included inside footer.php if you want to use its functions there.