Nigel12 Posted October 7, 2012 Share Posted October 7, 2012 Hi, I have been trying to display images from a directory on to a webpage. The code I am using is here and it is in 2 parts, I have a directory called "upload" which is where my images are. I have created a php file and called it getimages.php I put the php file in my directory called "upload" where my images are the code in it is <p> Link to comment https://forums.phpfreaks.com/topic/269198-trying-to-display-images-from-a-directory-on-to-webpage/ Share on other sites More sharing options...
Barand Posted October 7, 2012 Share Posted October 7, 2012 Hold on, I'll get my crystal ball! Link to comment https://forums.phpfreaks.com/topic/269198-trying-to-display-images-from-a-directory-on-to-webpage/#findComment-1383560 Share on other sites More sharing options...
maxudaskin Posted October 7, 2012 Share Posted October 7, 2012 You have to link to the image relative to the file that the user first loaded. If they loaded http : //www . example . com/dir/abcd/efg/index.php, and the image was in /dir/upload, you would have to either call the image relatively, ../../upload/image.jpg or absolutely, http : //www . example . com/dir/upload/image.jpg. Link to comment https://forums.phpfreaks.com/topic/269198-trying-to-display-images-from-a-directory-on-to-webpage/#findComment-1383564 Share on other sites More sharing options...
Nigel12 Posted October 9, 2012 Author Share Posted October 9, 2012 For some reason it only posed half of what I wrote Crystal balls are just a myth, a fantasy let's not get to carried away. But if you have a php script that can make one let me have a copy it might let me know what to buy the wife for Christmas I will update my post later when I have access to it. I am not at home right now. Link to comment https://forums.phpfreaks.com/topic/269198-trying-to-display-images-from-a-directory-on-to-webpage/#findComment-1383890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.