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> Quote 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! Quote 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 (edited) 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. Edited October 7, 2012 by maxudaskin Quote 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 (edited) 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. Edited October 9, 2012 by Nigel12 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.