Welcome Guest, Not a member yet? Register   Sign In
using built-in functions in config files
#1

[eluser]Unknown[/eluser]
Hi guys,

I'm setting up some constants in constants.php, it looks like this:

Code:
define ('CSS_FOLDER','http://www.planet-obuca.com/elviton/css/');
define ('IMG_FOLDER','http://www.planet-obuca.com/elviton/img/');

However, it would be nice if I could use site_url instead of typing the url, something like this:

Code:
define ('CSS_FOLDER', site_url('/css/'));
define ('IMG_FOLDER', site_url('img/');

Any ideas how to fix this?

Thanks, Gregor
#2

[eluser]John_Betong_002[/eluser]
Try this KLUDGE:

Code:
define( 'SITE_URL', 'http://' .echo $_SERVER['SERVER_NAME'] .'/' );

  define ( 'CSS_FOLDER', SITE_URL .'css/' );
  define ( 'IMG_FOLDER', SITE_URL .'img/' );
 
 




Theme © iAndrew 2016 - Forum software by © MyBB