我们如何在一个 php 页面中调用多个 php 页面?

how can we call multiple php pages in one php page?

我有 4 php 个页面用于不同的目的,它们如下:

readxmlfile.php : 用于从"result.xml"文件中读取数据并将数据插入到"ci_result" table中。将数据插入"ci_result"table后,数据如下:

id     result_list
1      Name = Ciclo-Attivo@Application solutions = @Softwares = @Application solutions = Portale-Ciclo-Attivo$ 1 3$ Ciclo-Attivo$ Portale-Ciclo-Attivo@map level = 0@CI Type = Business Process@                                          
2      Name = Portale-Ciclo-Attivo@Application solutions = @Softwares = @CIs = Fatturazione$ 3 4$ Portale-Ciclo-Attivo$ FatturazionedArco-Portal$ 3 6$ Portale-Ciclo-Attivo$ dArco-PortalMYLFRAdmin SR-CTH3G01$ 3 9$ Portale-Ciclo-Attivo$ MYLFRAdmin SR-CTH3G01@Impact analysis: configuration of the redundancy = The solution is up if all CIs are up@map level = 1@CI Type = Application Solution@ 

等等...

loaddataintomaptable.php : 用于从"ci_result" table中读取数据并插入"map_node"和"map_edge"table.

update_map_tables.php : 用于更新 "map_node" 和 "map_edge" table.

中的记录

generate_bp_conf.php:用于更新"map_node"和"map_edge"后生成"bp.conf"文件tables.

当我 "run" 页面在 Web 服务器上一个一个地工作时,这 4 个 php 页面工作正常。现在我想在一个 php 页面中调用 4 php 个页面以减少额外的步骤。有谁知道如何在一个 php 页面中调用多个页面?确切地说,我们可以在一个 php 页中为这 4 个页面做“http://localhost/web/pages/readxmlfile.php”吗?

您可以创建一个 index.php 文件,实际上您可以这样做:

if(isset($_GET['page'])){
    $page = $_GET['page'];
}
include_once 'layout.php';

在layout.php中:

<!DOCTYPE html>
<html>
....
<body>
<?php include $page.'.php'; ?>

您可以尝试这样的操作:

<?php
include 'readxmlfile.php';
include 'loaddataintomaptable.php';
include 'update_map_tables.php';
include 'generate_bp_conf.php';