如何在PHP代码中嵌入html文件? [英] how to embed html files in php code?

查看:643
本文介绍了如何在PHP代码中嵌入html文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多html文件,现在我想用一些php代码逐个调用每个文件。但每当我尝试运行php代码从文件夹中调用这些html文件,它都无法正常工作。

  1.html视图
2.html查看
3.html查看

因此,1,2和3是html文件,现在通过点击查看用户应该被引导到链接。我如何解决在PHP中整合html文件的问题,以便这些文件将以视图选项逐个显示给用户。每当用户点击查看时,用户都会看到html页面。


$ b 注意:即时消息在Windows7中使用xampp服务器



任何建议将不胜感激......

解决方案

使用包括PHP函数为每个html文件。



例子:

 <?php 
// do php stuff

include('fileOne.html');
include('fileTwo.html');

?>


I have many html files and now i want to call each of the files one by one using some php code. but whenever i try to run the php code for calling those html files from the folder, it doesnot work.

    1.html view
    2.html view
    3.html view

So, 1,2 and 3 are the html files and now by clicking view user should be directed to the link. How can i solve the problem for incorporating html files in php, so that the files will be displayed to user one by one with a view option. And whenever user will click view, user will get the html page viewed.

Note: i m using xampp server in windows7

Any suggestions will be appreciated...

解决方案

Use the include PHP function for each html file.

example:

<?php
// do php stuff

include('fileOne.html');
include('fileTwo.html');

?>

这篇关于如何在PHP代码中嵌入html文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆