View Full Version : Using constants

01-07-2008, 02:37 PM

I have a little issue with the usage of constants in PHP.
In the config file I want to define constants for example to point to the current version of the software used :

define("VERSION", "/var/www/html/domain/code/beta/1.0");

Now when I want to use this in require_once statements it is not working how I would expect it and so I hope someone can help me out what am doing wrong here:


I have tried to use {} around the constant name, but this also doesn't work.
What am I doing wrong please?

Many thanks,

01-07-2008, 02:41 PM
Should work -

require_once(VERSION . "/database.inc.php");

01-07-2008, 02:48 PM
Should work -

require_once(VERSION . "/database.inc.php");

Thanks... exactly what I needed

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum