Javascript 如何在没有iFrame的html上显示来自其他服务器的PHP页面?

Javascript 如何在没有iFrame的html上显示来自其他服务器的PHP页面?,javascript,php,jquery,html,iframe,Javascript,Php,Jquery,Html,Iframe,我有以下iFrame HTML: <html> <iframe src="page.php" id="ifrm" height = 100% width = 100% ></iframe> </table> </html> 我使用它在html页面中显示PHP 然而,iframes让我很难过。有没有其他不使用iFrame的解决方案 基本上我需要的是HTML页面在不改变浏览器url的情况下显示php页面 顺便说一句:两个页面都在不同的服

我有以下iFrame HTML:

<html>
<iframe src="page.php" id="ifrm" height = 100%  width = 100% ></iframe>
</table>
</html>
我使用它在html页面中显示PHP

然而,iframes让我很难过。有没有其他不使用iFrame的解决方案

基本上我需要的是HTML页面在不改变浏览器url的情况下显示php页面

顺便说一句:两个页面都在不同的服务器上


谢谢

您可以尝试读取包含file\u get\u内容的文件,然后打印它:

<?php
    $sContent =  file_get_contents('page.php'); //Replace 'page.php' with the full URI to the pages you want to show
    print ($sContent);
?>

这将适用于大多数服务器设置,但并不总是如此。

您可以使用函数文件\u get\u contents


这取决于PHP脚本所做的工作。你的意思是iFrame是唯一的解决方案吗?不,这不是我想说的。还有其他一些解决办法。我想说的是,根据您想要包含的页面内容,您不能使用此页面的功能。因此,您可以显示它,但可能userinputs不会给您带来您想要的结果。您考虑过使用ajax调用吗?然后,您可以使用Javascript手动加载页面…结束标记在那里做什么?不起作用。。。它基本上是一个html页面,而不是PHP。如果可能的话,我需要一个HTML解决方案。
$externalWebsite = 'http://externalsite.com/page';
$externalContent = file_get_contents($externalWebsite);
echo $externalContent;