So i need to include a config File from 3 Directories above. File Structure: root/template/default/premium/myFile.php I am trying to include: root/include/config.php
My attempts:
if(include('../../../include/config.php') == true){
echo "Config loaded succesfully<br>";
}else{
echo "There was a Big Time Error loading the Config!<br>";
}
This one is not working, I keep getting the Big Time Error Message ;)
Next i tried with:
include($_SERVER['DOCUMENT_ROOT'] . '/include/config.php');
Also no Luck with this one if I try to access my defines it´s not working.
After Dormilich suggestion on checking the manual i found a Mistake and changed my Code as followed:
if((include'../../../include/config.php') == true){
echo "Config loaded succesfully<br>";
}else{
echo "There was a Big Time Error loading the Config!<br>";
}
Still not working
if((include $_SERVER['DOCUMENT_ROOT'] . '/include/config.php') == true)
{
echo "Config loaded succesfully<br>";
}
else
{
echo "There was a Big Time Error loading the Config!<br>";
}
This did the Trick for me. I think i may just mispelled somewhere. But still thanks for bringing the Attention again to the manual.