模板的php脚本

来源:百度知道 编辑:UC知道 时间:2024/05/02 04:55:30
在运行这个模板的脚本后,网页中没有任何显示(没有错误警告)。请问可能是什么原因?
<?php
require_once "HTML\Template\It.php";
$row["{firstname}"]=1;
$template = new HTML_Template_IT("./templates");
$template->loadTemplatefile("example1.tpl",true,true);
$template->setCurrentBlock("CUSTOMER");
$template->setVariable("{FIRSTNAME}", $row["{firstname}"]);
$template->parseCurrentBlock();
$template->show();
?>

模板
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD THML 4.01 Transitional//EN"
"http://www.w3.org/TR/html401/loose.dtd">
<html>
<head>
<meta http-equiv="content-Type" content="text/html; charset=iso-8859-1">
<title>Customer Details</title>

语法错误是会有提示的。。
按楼主所说的没有任何提示也许是路径问题。引用文件时出错了。下面当然不会有显示。。但是由于PHP配置中把这个错误提示设为了不提示。。就不会有出错提示了。。

可以试试这么改。
require_once(".\HTML\Template\It.php");

把$row["{firstname}"]中两个大括号去掉试试。。。