2016-11-21 26 views
0

此問題可能是有關權限,但我不知道如何解決這個無法加載從不同的目錄圖像交友

我的結構是這樣的:

public_html/ 
    ➥ foto_produk/ (this where I store the images) 
     alpha/ (this where my subdomain files are) 
     ➥ thing.php 

現在的html加載圖像

<?php 
    echo"<img src='../foto_produk/image.jpg'/>"; 
    ?> 

圖像在localhost中成功加載,但不在cpanel託管。 當我嘗試改變權限foto_produk文件夾已經是按用戶組和世界可讀的,或者我需要檢查所有的選項?

enter image description here

當我嘗試檢查控制檯,URL指向子域目錄 subdomains/foto_produk/images file,而不是主域目錄

enter image description here

+0

嘗試只寫'回聲「」;' 或者只是給予充分的鏈接,這個問題 – KinjalMistry

+0

喜。這將使用從子域的文件夾,我想存儲在主域的1個文件夾中的'produk'的所有圖像,因此我試圖找到一種方法來加載子域的主域上的圖像 – Citra45Abadi

+0

http:// alpha .rajafotocopy.com/<<這裏的鏈接到我的問題 – Citra45Abadi

回答

0

別介意我得到了這一點。

只需要編寫主域名URL前/ foto_produk

echo"<img src='maindomain.com/foto_produk/image.jpg'/>";

我不認爲這是最好的解決辦法....如果有其他的解決方案比這更好的,請分享答案