I have two domains in same server. www.domain1.com & www.domain2.com.
in www.domain1.com, there is a folder called 'Pictures'. To that folder user can upload their pictures by creating a folder by their ID. (www.domain1.com/Pictures/User_iD) A thumbnail is created using uploaded image at the same time and being saved to this path which is created dynamically.(www.domain1.com/Pictures/User_iD/thumbs)
This is happening using PHP script in our system.
So my problem is, i need to display those User uploaded images in www.domain2.com. i have used following code to do that, but it is not working.
$image_path="http://www.domain1.com/Pictures/"."$user_id";
$thumb_path="http://www.domain1.com/Pictures/"."$user_id/"."thumbs";
$images = glob($image_path.'/*.{jpg,jpeg,png,gif}', GLOB_BRACE);
getting images like this,
foreach ($images as $image) {
// Construct path to thumbnail
$thumbnail = $thumb_path .'/'. basename($image);
// Check if thumbnail exists
if (!file_exists($thumbnail)) {
continue; // skip this image
}
but when i try to do that, images wont display on the www.domain2.com/user.php. if i use the same code to display images which are in the same domain, images are appearing fine.
Hope i explain the situation correctly. Please help.
Thanks in advance