Jump to content

Can someone explain this pathway issue


OAFC_Rob

Recommended Posts

When I do the following;

 

<?php echo $_SERVER['DOCUMENT_ROOT']."/innovationation1/commonResources/images/container/favicon.ico"; ?>

 

I get output like this: C:/xampp/htdocs/innovationation1/commonResources/images/container/favicon.ico

 

but when implement that like this, it doesn't bring up the fav.icon even tho the pathway is correct.

 

<link rel="shortcut icon" href="<?php echo $_SERVER['DOCUMENT_ROOT'].'innovationation1/commonResources/images/container/favicon.ico'; ?>" />

Link to comment
https://forums.phpfreaks.com/topic/239448-can-someone-explain-this-pathway-issue/
Share on other sites

Make a base url constant with the URL to your root folder.

 

define('BASEURL', 'http://example.com/');

 

<link rel="shortcut icon" href="<?php echo BASEURL.'innovationation1/commonResources/images/container/favicon.ico'; ?>" />

or just start your urls with a /

<link rel="shortcut icon" href="/innovationation1/commonResources/images/container/favicon.ico" />

Make a base url constant with the URL to your root folder.

 

define('BASEURL', 'http://example.com/');

 

<link rel="shortcut icon" href="<?php echo BASEURL.'innovationation1/commonResources/images/container/favicon.ico'; ?>" />

or just start your urls with a /

<link rel="shortcut icon" href="/innovationation1/commonResources/images/container/favicon.ico" />

 

Wouldn't that be relative to your current directory?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.