# PHP Include Breaks Relative Image Links

**URL:** <https://forum.kirupa.com/t/php-include-breaks-relative-image-links/225676>\
**Category:** programming\
**Created:** [May 14, 2007, 8:38pm UTC](https://forum.kirupa.com/t/php-include-breaks-relative-image-links/225676 "2007-05-14T20:38:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kBisk](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kBisk](https://forum.kirupa.com/u/kBisk)\
**Post date:** [May 14, 2007, 8:38pm UTC](https://forum.kirupa.com/t/php-include-breaks-relative-image-links/225676/1 "2007-05-14T20:38:08Z")

</div>

I’m including just the content sections of pages in one main PHP “shell” file. So, near the middle of the page, depending on the requested content, a php file is included from a sub folder, say “/content/mypage.php”;

it is then displayed on the main shell php page “/index.php”.

However, the “/content/mypage.php” may have image links like “…/images/myimage.jpg” but when its displayed in the shell file, the url should be “/images/myimage.jpg”.

Is there any way to use php to remove the relative link folders ("…/") or is there another way around this?

I hope I’ve explained this well enough. Thanks for any help.
