graham23s Posted July 4, 2008 Share Posted July 4, 2008 Hi Guys, on one of my sites i have a folder of images, i was wanting to read and loop through these images displaying random ones from another one of my sites! so www.site1.com/images/images.jpg read and display these on www.site2.com is that possible? cheers guys Graham Quote Link to comment Share on other sites More sharing options...
ratcateme Posted July 4, 2008 Share Posted July 4, 2008 you could put all the images in a database on site2 then when you want pick some random rows then show them using <img> tags Scott. Quote Link to comment Share on other sites More sharing options...
taith Posted July 4, 2008 Share Posted July 4, 2008 or... just $imgs=glob('imagefolder/*.jpg'); $img=$imgs[array_rand($imgs)]; Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 4, 2008 Share Posted July 4, 2008 @taith: No, they're on different servers. Quote Link to comment Share on other sites More sharing options...
br0ken Posted July 4, 2008 Share Posted July 4, 2008 If the two sites are both based on the same server then by configuring the permissions you can do this however like DarkWater says, if they're on different servers you can't do it. One way around it is on the site with the images, you could add all of their names to a CSV (comma seperated values) file and then grab that using file_get_contents, process it voilla, you have your images! Quote Link to comment 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.