PHP Code:
define('CURRENT_DIR', $_SERVER['DOCUMENT_ROOT']);
chdir('/home/sporthoj.com/www/www.sporthoj.com/forum');
require('./global.php');
if(CURRENT_DIR) {
chdir(CURRENT_DIR);
} else {
chdir('/home/sporthoj.com/www/www.sporthoj.com');
}
Not sure why you have the if statement as its not really needed. Anyway the above example will work as vB unsets the majority of variables at the start of the script for safety reasons.