yb1yb 发表于 2010-1-12 17:44:06

php include 两个同名文件出错,求救!

/config.php
/connet.php
    include config.php


/admin/config.php
/admin/index.php
    include ../connet.php
    include config.php


请看我在执行index.php文件是
connet.php 调用了根目录的config文件
在index.php本身中调用了他自己目录下的config文件..
这样操作后,,
index.php就无法收到 /config.php 这个文件中的值了

我在很多服务器上这么写都没有出错,现在这台用iis配的服务器就出错了,
请高手指教一下要怎么办啊,应该 是修改iis->php,ini的内容吧

netwolf103 发表于 2010-1-18 16:42:00

include_once 试下

雨天故事 发表于 2010-4-28 02:32:08

换成include_once 这样只会加载一次,第二次检测到同样的,就不会加载了。
页: [1]
查看完整版本: php include 两个同名文件出错,求救!