I have a few files in a directory, let’s say, named includes on my GoDaddy web server. The directory contains the files which have the snippets that get repeated in every file on the web server. Instead of manually including those snippets in every file, I want the server to read those files from that directory and include in the .htm that it’s about to send to the client.
I am able to include those files in the .htm files that are placed in the root directory of the server. However, when the directory changes, I do not know how to get the complete path relative to the current directory. Can anybody help me with resolving this matter. I want to include those files into a file that is located in posts/language/ directory.
I am using the following PHP command to include the files:
<?php include ("includes/scripts-and-style.htm"); ?>
I would like to add that it’s working for the file in the base folder. When the files move into the subdirectory, the server fails to find page_includes folder.