php include的问题 我的index.php中有include("right.php");right.php中有include("rightPart.php");我想让index2.php中也有right.php,但是不想让right.php中有rightPart.php请问代码怎么写? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 index2.php中来个$file = basename(__FILE__);right.php中来个if($file != 'index2.php'){ //do not include} 给你绕进去了这样的文件结构说明你没设计好rightPart.php不要在right.php里include 没有想到更好的办法,如果是我肯定把right.php里的include("rightPart.php")去掉然后保存为right2.php!在index2.php中写include("right2.php")。期待高手! right.php中有include("rightPart.php");rightPart.php和right.php分开写 分别导入 建议再进行分离,分别进行包含即可,如果实在要这样做,可以使用if(你要满足的包含条件){ include '文件地址';} 学习了,总结下。1、right.php中不定义include("rightPart.php"),在需要的文件分别include().2、定义两个right.php (right1.php,right2.php),一个定义include("rightPart.php"),一个不定义。3、3#,7#的方式,加个判断来灵活控制是否定义include("rightPart.php")。有待验证 include("rightPart.php");的时候做一下判断 jquery 修改button的click函数 apache配置中,路径可不可以使用相对路径? phpexcelreader 在xp运行正常,linux运行超时(急) 问下FOREACH问题 这段js运行一段时间后页面变卡了,怎么解决? 高手请指点 出错了呀!快快来看看呀 大家帮忙看看,我遇到一个奇怪的问题!急急,请各位帮忙 PHP中sendmail服务器如何配置,请大家帮忙,谢谢 apache 好端端的又出现错误了,该怎么解决? 类的基础知识? PHP怎样执行BAT文件,或者其他可执行文件??
来个
$file = basename(__FILE__);right.php中来个
if($file != 'index2.php'){
//do not include
}
这样的文件结构说明你没设计好
rightPart.php不要在right.php里include
期待高手!
rightPart.php和right.php分开写
分别导入
建议再进行分离,分别进行包含即可,如果实在要这样做,可以使用
if(你要满足的包含条件)
{
include '文件地址';
}
1、right.php中不定义include("rightPart.php"),在需要的文件分别include().
2、定义两个right.php (right1.php,right2.php),一个定义include("rightPart.php"),一个不定义。
3、3#,7#的方式,加个判断来灵活控制是否定义include("rightPart.php")。有待验证
的时候做一下判断