Jump to content

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.