分类分类
更新时间:2026-10-06 15:50:01作者:zhao
显示“Hello,world”程序编写例子
程序代码编写
存放目录格式:
插件程序存放目录用: /e/extend/helloworld/
插件程序模板存放目录用: /e/extend/helloworld/template/
所需程序文件:
/e/extend/helloworld/index.php 主程序文件
/e/extend/helloworld/template/index.temp.php 主程序模板文件
程序目录 模板目录


主程序文件内容(/e/extend/helloworld/index.php):
<?php
require('../../class/connect.php'); //引入数据库配置文件和公共函数文件
require('../../class/db_sql.php'); //引入数据库操作文件
$link=db_connect(); //连接MYSQL
$empire=new mysqlquery(); //声明数据库操作类
$editor=1; //声明目录层次
$context='Hello, World!'; //定义显示内容
require('template/index.temp.php'); //导入模板文件
db_close(); //关闭MYSQL链接
$empire=null; //注消操作类变量
?>
主程序模板文件内容(/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>显示内容为如下:</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

相关
摄像头远程监控看家2026官方最新版本生活服务36.4 MBv1.0.02026-10-06
下载公务员省考最新手机版学习办公57.5 MBv6.09.112026-10-06
下载野性蜂巢(Wild Hive)经营养成267.49 Mv1.66.42026-10-04
下载趣好卖app网上购物74.76 Mv5.2.52026-10-04
下载兔叽月记app医疗健康55.33 Mv1.5.22026-10-04
下载魔力弹神策略游戏33.56 Mv1.0.02026-10-04
下载大破坏幸存者策略游戏62.28 Mv1.0.32026-10-04
下载啃豆小仓拼豆app实用工具41.74 Mv1.32026-10-04
下载方块公国安卓移植版策略游戏1.58Gv1.2.202026-10-04
下载快车顺风车出行2026官方最新版本生活服务82.0 MBv1.1.22026-10-04
下载网约上门按摩2026官方最新版本生活服务73.9 MBv2.0.22026-10-04
下载道运考试通(道路考练工具)学习办公32.8 MBv6.0.12026-10-04
下载










