小编Fir*_*ght的帖子

在iframe html标记内使用php

我正在尝试创建一个在iframe中显示另一个网站的网站。

这是我的代码:

<html> 
<title>HTML with PHP</title>
<style>
body {
margin: 0px;
}
</style>
<body>
<?php
$page = $_GET['query'];
echo $page;
?>
<iframe align="center" width="100%" height="100%" src="<?=$page;?>" frameborder="yes" scrolling="yes" name="myIframe" id="myIframe"> </iframe>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

当我从网站上打开php文件(使用url website.com/file.php?query= https://www.google.com)并查看检查器时,可以看到iframe加载的页面,但它只是显示为空白页,而不是。我在 http://www.test.fire-light.tk/web.php?query=url(用任何有效的URL替换URL)上显示。不知道为什么它显示空白页。

html php iframe request-uri

1
推荐指数
1
解决办法
4万
查看次数

标签 统计

html ×1

iframe ×1

php ×1

request-uri ×1