PHP和MYSQL:php没有找到mysql给出的图像路径

uploading an image from sitename1.com and saving image path in mysql as "../sitename2/images/imagename.jpg" but when trying to display that image from different domain like sitename2.com, it's not finding the path remotely while working in localhost.I'm using IIS web server. Please help......

file name: image.php Domain: sitename1.com IIS website Physical path: C:\inetpub\wwwroot\sitename1

$img_file = basename($_FILES["uploadfile"]["name"]);
        $folderName = "../sitename2/images/";
        $ext = pathinfo($img_file, PATHINFO_EXTENSION);
        $filePath = $folderName. rand(10000, 990000). '_'. time().'.'.$ext;
    if($ext=="jpg" || $ext=="jpeg" || $ext=="gif" || $ext=="png"){  
        if ( move_uploaded_file( $_FILES["uploadfile"]["tmp_name"],    $filePath)) {mysqli_query($conn,......................

file name: displayimage.php Domain: sitename2.com IIS website Physical path: C:\inetpub\wwwroot\sitename2

$UploadFile = $row['UploadFile'];
echo'<img src="' . $UploadFile . '" height="50" width="50" class="pic"/>';

basically i am using 1st domain to only upload images and using 2nd to display it

sitename1.com only for customer sitename2.com only for admin

So you want to access shared resources from two separate domains? I think you'll need to setup a shared folder or virtual directory. This can also be called a symbolic link. Otherwise you would need to copy the assets from a folder under site1 to site2.

From your question it is not clear you understand how the local file system relates to your web URIs. If you can get a file to load on both domains, say c:\www\site1\images\imgA.png and c:\www\site2\images\imgB.png at http://site1.localhost/images/imgA.png and http://site2.localhost/images/imgB.png respectively, or something similar, then you are half way there! All you need to do is "link" the files in the folder. If you can't get that far then we need more info on specifically where its falling down.