我一直是做jsp的 这次为了帮朋友忙 做一个php的小网站 才csdn上下了一个源码修改
可部署上就各种错:
这是 index.php的代码<?php
/**
index.php  -  首页程序
***********************************************/
require_once "./include/base.php";
require_once "./include/depart.php";
//$treelist=display_tree_frontp($classid);
$index=1;
//======== 取首页切换图 ======================================================
$condition="where speltj=1";
$syqh=array();
$query = $db->query("SELECT * FROM $table_pic where class=1  order by id desc LIMIT 5");
$syqh= array();
$blinknum=$db->num_rows($query);
$tempj=0;
$i = 0;
while($dbq_rec = $db->fetch_array($query))
{
$i++;
$dbq_rec['viewtimes']=$i;
//$dbq_rec['subject']=wordscut($dbq_rec['subject'],20);
//echo $dbq_rec['viewtimes'];
$syqh[]=$dbq_rec;
}
unset($dbq_rec);//*************取首页显示图******************
$condition="where indextj=1";$yycp=array();
$query = $db->query("SELECT  * from $table_products $condition ORDER BY productid desc LIMIT 9");
$rows=2;
$tempnums=0;
for ($i=0;$i<=$rows;$i++)
{ $productlist=array();
$col=3;
for ($j=1;$j<=$col;$j++)
{
$tempnums++; //if ($tempnums>($productnum-$start_limit)) $productlist[]=$blink;
//else
//{
$dbq_rec=$db->fetch_array($query);

$dbq_rec['postyear']=date('Y',$dbq_rec['posttime']);
$dbq_rec['postdate']=date('m-d',$dbq_rec['posttime']);
$dbq_rec['posttime']=date('Y-m-d',$dbq_rec['posttime']);
$productlist[]=$dbq_rec;
//}
}
$yycp[]=$productlist;
unset($productlist);
}
//=====================取招聘信息========================================
$query = $db->query("SELECT * FROM $table_documents where class=2  order by id desc LIMIT 5");
$zxzp= array();
$blinknum=$db->num_rows($query);
$tempj=0;
while($dbq_rec = $db->fetch_array($query))
{


$dbq_rec['subject']=wordscut($dbq_rec['subject'],20);
$zxzp[]=$dbq_rec;
}
unset($dbq_rec);//==============================促销信息==============================
$query = $db->query("SELECT * FROM $table_documents where class=1  order by id desc LIMIT 4");
$hydx= array();
$blinknum=$db->num_rows($query);
$tempj=0;while($dbq_rec = $db->fetch_array($query))
{   
    $i++;
$dbq_rec['subject']=wordscut($dbq_rec['subject'],30);

$hydx[]=$dbq_rec;
}
unset($dbq_rec);include template('index');
?>我把路径改了 时区改了 现在报include template('index'); 这一行的错
0 @filemtime($objfile)) { require_once $shop_root.'./include/template.php'; //parse_template($file, $templateid, $tpldir); parse_template($tplfile,$objfile); } // } return $objfile; } function showmessage($show_message, $url_forward = '') { extract($GLOBALS, EXTR_SKIP); include language('messages'); if(isset($language[$show_message])) { eval("\$show_message = \"".$language[$show_message]."\";"); } $url_redirect = $url_forward ? '' : NULL; if ($url_forward == '') unset($url_forward); include template('showmessage'); exit; } ?>
Fatal error: Call to undefined function template() in D:\www\tjaitong\index.php on line 96这是什么原因啊 我百度google都找不到答案... 我查了 在templates 文件夹里有index.htm 文件
谁能告诉我啊 急等

解决方案 »

  1.   

    undefined function template() 
    函数名未定义检测函数名拼写,或者自己写相应功能的函数
      

  2.   

    它还是用的模板系统。
    估计是没有将系统的模板解释文件包含进来。
    导致找不到template函数。
    只有自己在相应的文件里找下,找到文件并包含进来。