I am getting the expected return with $_SERVER['DOCUMENT_ROOT'], but when i click the link, the string the constant contains is just appending to the web address already there.
For instance i have :
define("ROOT_PATH",$_SERVER["DOCUMENT_ROOT"].'/webroot/mysite/');
then later a link (intended for the root of my site)
$hud .= '<a href="'.ROOT_PATH.'" class="nav_links">Home</a>';
I click the link it gives me this error:
The requested URL /mysite/home/content/39/11607339/html/mysite/includes was not found on this server.
Can someone tell me why it is just appending to the url rather than normal behavior which is just go to that file?
try $_SERVER['HTTP_HOST'] instead of $_SERVER['DOCUMENT_ROOT'] in define function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With