我如何访问父文件夹php中的文件夹或文件

gin*_*gin 2 html php shared-directory

我想要一个共享文件夹,其中包含子文件夹内的html页面访问的图像.(子文件夹)

Tes*_*rex 11

如果你的意思是你的html文件夹和图像文件夹是兄弟姐妹,你可能正在寻找..目录...嗯,东西.

你的文件看起来像:

/www
    /html
        index.php
    /images
        myimage.png
Run Code Online (Sandbox Code Playgroud)

写一个这样的img标签:

<img src="../images/myimage.png" />
Run Code Online (Sandbox Code Playgroud)


SLa*_*aks 7

在您的网站中创建一个文件夹并将图像放入其中.