PHP - 包含在subdir不工作 [英] PHP - include in subdir not working

查看:187
本文介绍了PHP - 包含在subdir不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我有的

site.com/user/filehere.php

我需要去

site.com/user/messages/index.php 

index.php是

the index.php is

<?php 
include_once("../filehere.php");
?>

问题出在 filehere.php

还有另外一个包括如

filehere.php

filehere.php

<?php  

include_once("../menu.php); 

?>

这些包括没有重新配置在/ messages dir中,即使当我直接查看包含的文件时, p>

and these includes are not reconized in the /messages dir even when it's all ok when I acess directly the included file

推荐答案

添加 __ DIR __ 代表当前的php目录。有关更多信息,请参阅此帖子

这篇关于PHP - 包含在subdir不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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