免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1697 | 回复: 2
打印 上一主题 下一主题

读程序时遇到个问题!希望大家能帮下! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-03-14 14:23 |只看该作者 |倒序浏览
有3个页面
1.index.php
[php]<?php
session_cache_limiter('private,must-revalidate');
session_start();

require_once './include/common.inc.php';                 //
require_once ROOT.'./bbs/config.inc.php';            //数据库连接文件


require_once ROOT.'./include/smarty/mysql.class.php';     //smarty模板引擎和类!?
require_once ROOT.'./include/smarty/smarty.class.php';



$db=new DB_SQL;
$db->connect($DB ,0);
unset($DB);


$smarty= new Smarty;
$smarty->template_dir        = './templates/';
$smarty->compile_dir        = './templates_cache/';
$smarty->left_delimiter        = '<{';
$smarty->right_delimiter    = '}>';

$PHP_SELF=$_SERVER['PHP_SELF'];


define("IN_WEB" ,1);

require_once ROOT.'./include/query.inc.php';
require_once ROOT.'./include/func.inc.php';
require_once ROOT.'./include/global.inc.php';

$session_id=session_id();

$smarty->assign(array("PHP_SELF"=>$PHP_SELF,"WebTitle"=>$comname));


switch($N) {
    case "Register":     require_once './modules/register.php';        break;
    case "OnlineSige":     require_once './modules/OnlineSige.php';    break;
    default :            require_once './modules/Main.php';            break;
}

?>[/php]

2.Main.php
[php]<?php
if(!defined("IN_WEB")) die("Access Denied!");
require_once("head.php");
$smarty->display("index.htm");
?>
[/php]

3.head.php
[php]<?php
if(!defined("IN_WEB")) die("Access Denied!");
$smarty->display("inc/head.htm");
?>[/php]


现在的问题是
我在 main.php中 想引用头部文件  
但是 读取出来的页面 只有头部  没有 index.htm页

要如何解决呢!?

论坛徽章:
0
2 [报告]
发表于 2008-03-14 14:38 |只看该作者
2.Main.php
[php]<?php
if(!defined("IN_WEB")) die("Access Denied!");
require_once("head.php");
$smarty->display("index.htm");
?>
[/php]

如果我改成

2.Main.php
[php]<?php
if(!defined("IN_WEB")) die("Access Denied!");
require_once("head.php");
echo "========";
$smarty->display("index.htm");
?>

哪么 除了 头部文件外 其他的什么也不读取……  
[/php]

论坛徽章:
0
3 [报告]
发表于 2008-03-14 16:46 |只看该作者
在你程序开头加error_reporting(E_ALL&~E_NOTICE);

看看出现啥错把。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP