【发布时间】:2012-09-30 15:08:25
【问题描述】:
我正在添加一个包含 php 的绝对路径。
$path="/";
instead of include('../connect.php');
i want to include like include($path.'connect.php');
【问题讨论】:
标签: php include-path
我正在添加一个包含 php 的绝对路径。
$path="/";
instead of include('../connect.php');
i want to include like include($path.'connect.php');
【问题讨论】:
标签: php include-path
我正在使用类似的东西。我正在使用链接中的 p 值来获取我的页面。 我在这里也拔出了你指的sn-p
$pages_dir = 'inc/content';
include($pages_dir.'/'.$p.'.inc.php');
【讨论】:
如果你正在使用任何框架,那么就按照那个,否则你可以做以下:
$path = __DIR__;
include($path . '/connect.php'); // change this to match path
【讨论】: