|
查看: 1299|回复: 6
|
关于php的relative path??
[复制链接]
|
|
|
我现在使用xampp, 想知道在同一个directory里的file, 在code 里应该怎样point.... 比如, 在htdocs 里有 A.php 和B.php, 我要在 B.php里 加link <a href = '/A.php'>, 这样对吗? 可是我的出现error 在link 那一行, 是不是relative path point 错了???
[ 本帖最后由 eistern 于 29-11-2009 10:25 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 1-12-2009 07:20 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 7-12-2009 05:18 PM
|
显示全部楼层
我要在 B.php里 加link <a href = '/A.php'>
這個錯了。要用 ./A.php
/A.php 會跑回 root partition. |
|
|
|
|
|
|
|
|
|
|
发表于 19-12-2009 07:33 PM
|
显示全部楼层
|
用 include 或 include_once 'x.php';? 不懂有没有关系到framework...试试看.... |
|
|
|
|
|
|
|
|
|
|
发表于 20-12-2009 02:22 PM
|
显示全部楼层
用 include 或 include_once 'x.php';? 不懂有没有关系到framework...试试看....
davidbilly87 发表于 19-12-2009 07:33 PM 
include不可以乱乱用哦  |
|
|
|
|
|
|
|
|
|
|
发表于 20-12-2009 03:20 PM
|
显示全部楼层
include不可以乱乱用哦
小陈陈 发表于 20-12-2009 14:22 
为什么? 那他多了一个"/",如果是同一个location. |
|
|
|
|
|
|
|
|
|
|
发表于 21-12-2009 12:59 PM
|
显示全部楼层
include 是要小心用。尽量避免用 variable 来做。
/ 的用处是在首个文件夹内进行处理。
./ 是当前文件夹
../ 是上一个文件夹 |
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|