
January 23rd, 2013, 06:14 AM
|
|
Registered User
|
|
Join Date: Feb 2011
Posts: 2
Time spent in forums: 1 h 5 m 55 sec
Reputation Power: 0
|
|
|
PHP-General - Need help in using a variable in a file
Hi,
i have a config file placed in folder (/root/include/config.php)
PHP Code:
define('SITE_BASE_PATH' , '/home/techsite/public_folder/');
define('SITE_BASE_URL' , 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('SERVER_TYPE', 'dev');
Can anyone explain me what does the above line means and how is SITE_BASE_PATH and SITE_BASE_URL = getting values. (i mean what values does these variables hold)
Another thing. i have rest of my php files (related to website ) placed in /root directory. i am using the below snippet in the code to get BASE_URL AND PATH and its not working
Code:
li class="menuitem"><a href="<?=SITE_BASE_URL;?>index.php">Home</a></li>
<li class="menuitem"><a href="<?=SITE_BASE_URL;?>display.php">Recent Research</a></li>
<li class="menuitem"><a href="<?=SITE_BASE_PATH;?>conferences.php">Conferences</a></li>
<li class="menuitem"><a href="<?=SITE_BASE_PATH;?>read.php">Publication</a></li>
the above data is present in file (index.php) placed at /root.
can someone kindly explain me why what i am doing wrong as i am new to php. please forgive if i have done any noobish mistakes.
|