Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //content of config.php
- define('FRONTROOT', dirname(__FILE__).'/');
- define('BACKROOT', dirname(__FILE__).'/admin/');
- ?>
- <?php
- //content of /home/username/public_html/index.php aka frontend
- require(dirname(__FILE__).'/config.php');
- print_r(FRONTROOT); # should print /home/username/public_html/
- print_r(BACKROOT); # should print /home/username/public_html/admin/
- ?>
- <?php
- //content of /home/username/public_html/admin/index.php aka backend
- require(dirname(__FILE__).'/../config.php');
- print_r(FRONTROOT); # should print /home/username/public_html/
- print_r(BACKROOT); # should print /home/username/public_html/admin/
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement