search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Development example: display "Hello, world"

Collection 47
Read 29172
update time 2016-09-11
Display "Hello, world" programming example Program code writing Storage directory format:
Plug-in program storage directory: /e/extend/helloworld/
Plug-in template storage directory uses: /e/extend/helloworld/template/
Required program files:
/e/extend/helloworld/index.php Main program file
/e/extend/helloworld/template/index.temp.php Main program template file

Program Directory Template Directory
Main program file content(/e/extend/helloworld/index.php):
<?php
require('../../class/connect.php'); //Introduce database configuration files and public function files
require('../../class/db_sql.php'); //Introduce database operation files
$link=db_connect(); //Connect to MYSQL
$empire=new mysqlquery(); //Declare database operation class
$editor=1; //Declare the directory hierarchy

$context='Hello, World!'; //Define display content
require('template/index.temp.php'); //Import template file

db_close(); //Close the MYSQL link
$empire=null; //Cancel operation class variables
?>


Main program template file content(/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>Show<?=$context?>Example</title>
</head>
<body>
<br>
<br>
<br>
<table width="500" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
</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>
Note: The template can be visually produced with Dreamweaver. The blue part of the code does not allow direct access to the template file. Access the main program of the Hello World plug-in file: /e/extend/helloworld/index.php
Hot AI Tools
Undress AI Tool
Undress AI Tool

Undress images for free

AI Clothes Remover
AI Clothes Remover

Online AI tool for removing clothes from photos.

Undresser.AI Undress
Undresser.AI Undress

AI-powered app for creating realistic nude photos

ArtGPT
ArtGPT

AI image generator for creative art from text prompts.

Stock Market GPT
Stock Market GPT

AI powered investment research for smarter decisions

Popular tool
Notepad++7.3.1
Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version
SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1
Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6
Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version
SublimeText3 Mac version

God-level code editing software (SublimeText3)