I have been using to get my files
<?php include 'example.html'; ?>
however how do you get them if they are in a subfolder: For example
pictures/example.html
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The best practice for this is to define a
ABSOLUTE_PATHconstant that contains the directory that everything is located under. After that, you can simply copy and paste everything, because it is defining the ‘full’ path, which doesn’t change from directory to directory.E.g
define("ABS_PATH", $_SERVER['DOCUMENT_ROOT']);or
define("ABS_PATH", dirname(__FILE__));// This defines the path as the directory the file is in.
Then at any point you can simply do this to include a file
include(ABS_PATH . "/path/to/file");