March 1, 2014

How to define your SITE_URL?

How to define your SITE_URL?

$self = explode('/', $_SERVER['PHP_SELF']);
array_pop($self);
define('SITE_URL', 'http://'.$_SERVER['HTTP_HOST'].implode('/', $self).'/');
define('IMG', SITE_URL.'assets/uploads/');

Last updated: March 19, 2014