简体   繁体   English

如何在html中加载一个php页面以及一个弹出按钮

[英]how to load a php page in html and also a button for pop-up

Describing as example: assume A= www.domain.com/test.html is a page and B = www.domain/php/forum/ is another php running forum .举例说明:假设 A= www.domain.com/test.html 是一个页面,而 B = www.domain/php/forum/ 是另一个 php 运行论坛。

it is possible to load B on A in somehow ?有可能以某种方式在 A 上加载 B 吗? and also how may I add php forums as a button popup ?以及如何将 php 论坛添加为按钮弹出窗口? php page is on another folder not in the same folder. php 页面位于不在同一文件夹中的另一个文件夹中。

please any advise.请任何建议。 Thanks谢谢

您可以通过 HTML 方式使用 iframe,也可以通过 php 方式通过 cURL 或 file_get_contents 获取页面。

Assuming you changed test.html to test.php you could include the index of you forum.假设您将 test.html 更改为 test.php,您可以包含论坛的索引。

<?php include 'php/forum/index.php'; ?>

I don't see why you would want to include it all however?我不明白为什么你想把它全部包括在内? Perhaps make a widget that shows some useful information that you want on your homepage and include that?也许制作一个小部件,在您的主页上显示一些您想要的有用信息并将其包含在内?

The easiest way to do what you want to do is to use an iframe to embed one document into another.做您想做的事情的最简单方法是使用iframe将一个文档嵌入到另一个文档中。 For the most basic implementation your HTML on www.domain.com/test.html would look like对于最基本的实现,您在www.domain.com/test.html上的 HTML 看起来像

<iframe src="www.domain/php/forum/"></iframe>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM