根目录? [英] Root Directory?

查看:152
本文介绍了根目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


$ b

  root $ b我在根目录下的一个文件夹中编辑一个文件。 $ b  -  images 
- m
- - index.php

如果我想要从index.php抓取图像文件夹,我该怎么做呢?我试过:

  ../ images 

我不想使用我的网站网址。 如果您知道图像目录位于根目录中,请使用 / images 而不是 ../ images 。这将从任何路径解析到根目录中的图像。



例如,如果您在页面上 /pages/html/MyPage.html 路径 / images 仍然会解析为根目录中的images目录,而 ../ images 会解析为 / pages / images


I'm editing a file in a folder in my root directory.. here's a quick tree:

root
- images
- m
- - index.php

If I want to grab the images folder from index.php, how would I go about doing that? I've tried:

../images

I want to eliminate having to use my website URL.

解决方案

you should use /images instead of ../images if you know the image directory is in the root. this will resolve to a directory named images in the root from any path.

eg if you are on page /pages/html/MyPage.html the path /images will still resolve to the images directory in root whereas ../images would resolve to /pages/images.

这篇关于根目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆