x_maras Posted September 2, 2009 Share Posted September 2, 2009 Hi, I'm working on a wordpress website and I made a wrapper in order to include php files. In this php file there is a table and it has an image in some cells. Unfortunately the images doesn't appear and instead of them appears the alt text. There is no problem with the paths, I think, because I use some other pictures from the same folder for background, but I do it in the css file. I tried to put some images in the code but no image appears, only the alt. eg <?php echo " <div> here should appear:<br /> <img src='images/available.png' alt='available' title='image_test' /> <br /> but doesnt </div>"; ?> Something is wrong in the include I think, because I cant explain why the css reads the images and the html not. I would really appreciate any advice! Thank you in advance, Dinos Link to comment https://forums.phpfreaks.com/topic/172809-includes-php-file-but-doesnt-read-images/ Share on other sites More sharing options...
trq Posted September 2, 2009 Share Posted September 2, 2009 Is images/available.png a relative path from where the script is executed, not where the include file resides? Link to comment https://forums.phpfreaks.com/topic/172809-includes-php-file-but-doesnt-read-images/#findComment-910819 Share on other sites More sharing options...
x_maras Posted September 2, 2009 Author Share Posted September 2, 2009 no the images/available.png is a relative path from where the php file (the included one) is. In the same folder is also the css file and I use the same path for the css too. e.g td.example { background-image: url(images/example.png); } and this works. After reading your post I tried a relative path from where the wrapper is but nothing. I tried something like this before a couple of weeks with joomla and everything was working fine... Link to comment https://forums.phpfreaks.com/topic/172809-includes-php-file-but-doesnt-read-images/#findComment-910827 Share on other sites More sharing options...
trq Posted September 2, 2009 Share Posted September 2, 2009 Paths need to be relative from where the script is executed, not where any includes are located. Your better off using absolute paths if your having trouble. Link to comment https://forums.phpfreaks.com/topic/172809-includes-php-file-but-doesnt-read-images/#findComment-910830 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.