tecmeister Posted November 14, 2009 Share Posted November 14, 2009 Hi Guys, I'm having trouble viewing an image from a folder that is not in the same main directory. When I try and view it in the same main directory it is fine. <img src="<?php echo "../../".$data['imagePath'];?>" width="210px" height="auto" /> I have tried viewing the image not using php and it still has the same problem. <img src="../../Images/profile_image/tecmeister/n509028508_2928.jpg" width="210px" height="auto" /> I've also looked at the permission of the folder and it is fine. Quote Link to comment https://forums.phpfreaks.com/topic/181532-viewing-a-image-from-other-folders/ Share on other sites More sharing options...
Alex Posted November 14, 2009 Share Posted November 14, 2009 More than likely your problem is with the paths. You're going to have to show us how your directories and structured so we can help. Quote Link to comment https://forums.phpfreaks.com/topic/181532-viewing-a-image-from-other-folders/#findComment-957556 Share on other sites More sharing options...
tecmeister Posted November 14, 2009 Author Share Posted November 14, 2009 Both of these folders are in the users directory. The path that the image is in: Images->profile_image->tecmeister The path I'm trying to view from is: update->_INCLUDE->main.php Quote Link to comment https://forums.phpfreaks.com/topic/181532-viewing-a-image-from-other-folders/#findComment-957560 Share on other sites More sharing options...
Alex Posted November 14, 2009 Share Posted November 14, 2009 So it's like, commondir/Images/profile_image/tecmeister/someimage.. and trying to include it from commondir/update/_INCLUDE/main.php ? If so something like this should work: <img src="../../../<?php echo $data['imagePath'];?>" width="210px" height="auto" /> ../ goes up one directory. Quote Link to comment https://forums.phpfreaks.com/topic/181532-viewing-a-image-from-other-folders/#findComment-957565 Share on other sites More sharing options...
tecmeister Posted November 14, 2009 Author Share Posted November 14, 2009 I have just tried that and it doesn't work. I have know idea why it will not work. Thanks for your help thou. Quote Link to comment https://forums.phpfreaks.com/topic/181532-viewing-a-image-from-other-folders/#findComment-957582 Share on other sites More sharing options...
Alex Posted November 14, 2009 Share Posted November 14, 2009 Explain your directory structure better then.. I really don't know what you meant. Using -> To explain directory structure doesn't really make sense, and does _INCLUDE signify an include, or a directory name? Quote Link to comment https://forums.phpfreaks.com/topic/181532-viewing-a-image-from-other-folders/#findComment-957585 Share on other sites More sharing options...
tecmeister Posted November 14, 2009 Author Share Posted November 14, 2009 I have just figured it out there was only meant to be one ../. Even thou when I browse the image on dreamweaver it use two. Thanks for you help, tecmeister. Quote Link to comment https://forums.phpfreaks.com/topic/181532-viewing-a-image-from-other-folders/#findComment-957586 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.