."/> .">
search
HomeCMS TutorialEmpire CMSHow to set up the dynamic code for custom pages in Empire CMS

Steps to obtain dynamic code for Empire CMS custom page: Create a custom page and switch to HTML editing mode. Copy and paste the code, replacing the table name and sort field. Save the page and get the page address. Call the code at the desired location: .

How to set up the dynamic code for custom pages in Empire CMS

How to set up dynamic code for Empire CMS custom page

Step 1: Create a custom page

  • Log in to the Empire CMS backend.
  • Click "Page Management" → "Add Page" in the left menu bar.
  • Enter the page name and alias.

Step 2: Set up dynamic code

  • In the page content editor, switch to "HTML" mode.
  • Copy and paste the following code into the editor:
<?php 
$sql = "SELECT * FROM `表名` ORDER BY `排序字段` ASC"; 
$rs = $empire->query($sql); 
while($r = $empire->fetch($rs)) {
?> 

<!-- 输出动态内容 -->
<p>标题:<?php echo $r['title']; ?></p>
<p>内容:<?php echo $r['content']; ?></p>

<?php 
} 
?> 
  • Replace "table name" with the name of the table from which the data needs to be read.
  • Replace "sort field" with the sort field, usually "id" or "sort".

Step 3: Save the page

  • Click the Save button at the top of the page editor.

Step 4: Get the page address

  • Find the created custom page in "Page Management".
  • Copy its "page address".

Step 5: Call the custom page

  • Where dynamic content needs to be displayed, call the following code:
<iframe src="自定义页面地址" width="100%" height="1000"></iframe>
  • Replace "custom page address" with the page address copied in step 4.

The above is the detailed content of How to set up the dynamic code for custom pages in Empire CMS. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools