I have an issue with how the PHP includes are being picked up on my temporary URLs http://IPADDRESS/~USERNAME/SITENAME/ compared to my live URL http://LIVEDOMAIN.com
The PHP code that I am using is
? include($SERVER['DOCUMENTROOT'] . '/inc/php/header.php'); ?>
and it works great on the live domain because I guess it picks up the DOCUMENT_ROOT as the folder I set that domain up to be in cPanel?
But when I try to load the site on my temporary URL it says that it can't find the PHP include.
I'm on a shared host and I am the owner of many websites which is why they are within my username and sitename folders like that. Should I be using something else other than DOCUMENT_ROOT in order to view both the temporary URL and the live URL correctly?
Hope that makes sense!