include "config.php";
require("config.php");

解决方案 »

  1.   

    require_once "phpfile_name"; 仅允许在页面中包含一次该文件.
    以下两个要可以多次使用要包含的文件
    require "phpfile_name";
    include "phpfile_name";
      

  2.   

    如果是上一级目录呢?
    <?
    include "../top.php";?>
    好象抱错啊。
    Warning: main(top.php): failed to open stream: No such file or directory in D:\php\hz\user\login.php on line 1Warning: main(): Failed opening 'top.php' for inclusion (include_path='.;c:\php4\pear') in D:\php\hz\user\login.php on line 1
    同级可以,上一级怎么用??
      

  3.   

    include("../top.php");
    require("../top.php");
      

  4.   

    "../top.php"就是上一级目录的top.php文件
    报错应该是该文件不存在或路径不对
      

  5.   

    include("./config.php");
    require("./config.php");
    include_once("./config.php");include("../config.php");
    require("../config.php");
    include_once("../config.php");
      

  6.   

    include("../top.php");
    require("../top.php");