欧美日韩精品在线,国内精品久久久久久久久,一级毛片恃级毛片直播,清纯唯美亚洲综合欧美色

帝國CMS顯示“Hello,world”程序編寫例子_帝國Cms教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!
顯示“Hello,world”程序編寫例子
程序代碼編寫
存放目錄格式:
插件程序存放目錄用:/e/extend/helloworld/
插件程序模板存放目錄用:/e/extend/helloworld/template/
所需程序文件:
/e/extend/helloworld/index.php主程序文件
/e/extend/helloworld/template/index.temp.php主程序模板文件

程序目錄模板目錄
主程序文件內(nèi)容(/e/extend/helloworld/index.php):
<?php
require('../../class/connect.php'); //引入數(shù)據(jù)庫配置文件和公共函數(shù)文件
require('../../class/db_sql.php'); //引入數(shù)據(jù)庫操作文件
$link=db_connect(); //連接MYSQL
$empire=new mysqlquery(); //聲明數(shù)據(jù)庫操作類
$editor=1; //聲明目錄層次

$context='Hello, World!'; //定義顯示內(nèi)容
require('template/index.temp.php'); //導(dǎo)入模板文件

db_close(); //關(guān)閉MYSQL鏈接
$empire=null; //注消操作類變量
?>


主程序模板文件內(nèi)容(/e/extend/helloworld/template/index.temp.php):
<?php
if(!defined('InEmpireCMS'))
{
       exit();
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>顯示<?=$context?>例子</title>
</head>
<body>
<br>
<br>
<br>
<table width="500" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
 <tr>
   <td height="25"><strong>顯示內(nèi)容為如下:</strong></td>
 </tr>
 <tr>
   <td height="60" bgcolor="#FFFFFF"> <div align="center"><strong><font color="#FF0000" size="5"><?=$context?></font></strong></div></td>
 </tr>
</table>
</body>
</html>
說明:模板可用Dreamweaver可視化制作。其中藍色部分代碼為不允許直接訪問模板文件的作用。
訪問Hello World插件文件主程序:/e/extend/helloworld/index.php


查看更多 帝國cms教程  帝國cms模板

來源:未知//所屬分類:帝國Cms教程/更新時間:2012-10-13
相關(guān)帝國Cms教程