what are the pros and cons of using this :
$globals['server_url'] = dirname(__FILE__);
$globals['mainfiles'] = dirname(__FILE__).'/main';
and the pros and cons of using this :
$globals['server_url'] = '/srv/www/htdocs/somwhere/';
$globals['mainfiles'] = '/srv/www/htdocs/somwhere/main';
And what do you suggest.
by the way: these are set in config.php file which is called by other files as well, to stop directory conflicts when including files we use it like this :
require_once($globals['server_url'].'/test.php');
dirname(__FILE__)or__DIR__are better than'/srv/www/htdocs/somwhere/'because they will keep working the day you’ll move or rename your folders, or you migrate to another server or another OS.Portability and flexibility are the main words here.
And globals are bad.