动态图像SRC [英] Dynamic Image SRC
问题描述
我想在我的标题和导航中使用include,并且
因为后续文件可能在不同的目录中,我想
使用动态相对链接对于图像,有点像:
< img src ="<? $ root?> /images/foo.gif" />
我想最简单的事情就是使用绝对链接,但
是否有办法设置它,所以我可以改为PHP ?
TIA
Ian
-
http://www.bookstacks.org/
I would like to use an include for my header and navigation, and
because subsequent files may be in different directories, I want to
use a dynamic relative link for the images, sort of like:
<img src="<? $root ?>/images/foo.gif" />
I suppose the easiest thing to do is just use absolute links, but
is there a way to set this up so I can PHP instead?
TIA
Ian
--
http://www.bookstacks.org/
推荐答案
root ?> /images/foo.gif" />
我想最简单的事情就是使用绝对链接,但
是否有办法设置它,所以我可以改为PHP ?
TIA
Ian
-
http://www.bookstacks.org/
root ?>/images/foo.gif" />
I suppose the easiest thing to do is just use absolute links, but
is there a way to set this up so I can PHP instead?
TIA
Ian
--
http://www.bookstacks.org/
Ian Rastall写道:
Ian Rastall wrote:
我想在我的标题和导航中使用include,而
因为后续文件可能在不同的目录中,我想使用动态相对链接图像,有点像:
< img src ="<?
I would like to use an include for my header and navigation, and
because subsequent files may be in different directories, I want to
use a dynamic relative link for the images, sort of like:
<img src="<?
root?> /images/foo.gif" />
我想最简单的事情就是使用绝对链接,但
有没有办法设置它,所以我可以用PHP代替?
> TIA
Ian
root ?>/images/foo.gif" />
I suppose the easiest thing to do is just use absolute links, but
is there a way to set this up so I can PHP instead?
TIA
Ian
你好,Ian,
问题是:PHP如何知道哪条路径(相对或绝对路径)
应该添加
?
如果你能清楚地描述它,你可以编程PHP来做它。
我很确定。
但是你没有向我们提供任何有用的信息,所以我不确定你期望什么样的回答
。
>
至于语法:没关系,只要
Hi Ian,
The question is this: How can PHP know which path (relative or absolute)
should be added?
If you can describe it clearly, you can program PHP to do it.
I am sure of that.
But you didn''t provide us with any usefull information, so I am unsure what
kind of answer you expect.
As for the syntax: That is ok, as long as
这篇关于动态图像SRC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!