...

View Full Version : Using constants



twomt
01-07-2008, 03:37 PM
Hello,

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:


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

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

Many thanks,
twomt

CFMaBiSmAd
01-07-2008, 03:41 PM
Should work -

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

twomt
01-07-2008, 03: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