<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<?php
require("C:\AppServ\www\moka\top.php");
?>
</body>
</html>
我的top.php文件的路径为:C:\AppServ\www\moka\top.php
top.php的内容为:
<table width="750" height="131" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="images/banner.jpg">&nbsp;</td>
</tr>
</table>
怎么不能运行啊!!谢谢!!

解决方案 »

  1.   

    楼上正解:require("moka/top.php");//在moka目录下
    require("top.php");//在根目录下
      

  2.   

    相对地址或者使用 dirname(__FILE__) 。
      

  3.   

    自动加载
    define('COMMON_ROOT',dirname(__FILE__).DIRECTORY_SEPARATOR);
    function __autoload($className){
    include COMMON_ROOT.'classes'.DIRECTORY_SEPARATOR.$className.'.class.php';
    }
      

  4.   

    你要么用 Require("相對路徑/文件");
    要么就
    set_include_path('路徑');
    然後再require你管你是用require或者是include都可以,但是最好少用require_once或者include_once,因為後者效率低下
      

  5.   

    <input id="beginTime" type="text" size="32" name="beginTime" class="Wdate"
    onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'endTime\')}',readOnly:true});"
    value="${begin_time}" /> - 
    <input id="endTime" type="text" size="32" name="endTime" class="Wdate"
    onFocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'beginTime\')}',readOnly:true});"
    value="${end_time}" />
      

  6.   

     public static String getUniqueFileName(String fileName){
            String s = FastDateFormat.getInstance("yyyyMMddHHmmss").format(new Date());
            s += "_" + fileName;
            return s;
        }
      

  7.   

    Calendar cal = Calendar.getInstance();
            cal.setTime(new Date());
            cal.add(Calendar.DAY_OF_MONTH, -1);
            Date endDate = cal.getTime();
            System.out.println(endDate.toLocaleString());