Let's say that I have this website file root structure:
- frontend /home/username/public_html/
- backend /home/username/public_html/admin/
In frontend folder there is a file called config.php. In this file I get the site root of my website like this:
define('ROOT', dirname(__FILE__));
This file is also included in both index files (index.php) in frontend and backend. But for backend, the root is /home/username/public_html/admin/, which should actually be /home/username/public_html/. How can I do this, in one line, in config.php?
LE:
Demo code http://pastebin.com/LGrrJzaV