【发布时间】:2016-01-27 17:30:11
【问题描述】:
我按照@SequenceDigitale.com 的答案here 设置了一个外部iframe here。一切都很好,但是当我对表格数据进行排序或在该 iframe 中搜索时,页面会重新加载,但会出现旧设计。这是为什么?
代码
我正在使用此代码从外部资源中获取数据
<?php
$content = file_get_contents('http://www.exhibition-directory.com/expostars/index.php/');
$content = str_replace('</title>','</title><base href="http://www.exhibition-directory.com/expostars/" />', $content);
$content = str_replace('</body>','<link rel="stylesheet" href="http://www.informatixtech.com/expostars/wp-content/themes/hotstar-child/hotstar-child/custom.css" type="text/stylesheet" /></body>', $content);
$content = str_replace('</head>','<link rel="stylesheet" href="http://www.informatixtech.com/expostars/wp-content/themes/hotstar-child/hotstar-child/custom.css" type="text/stylesheet" /></head>', $content);
echo $content;
?>
这是我的 iframe 代码
<?php
echo '<iframe id="iframe" src="http://www.informatixtech.com/expostars/search-page.php" name="Stack" height="1200" frameborder="0" scrolling="auto" width="100%"></iframe>';?>
【问题讨论】:
-
因为当您提交表单时它会转到exhibition-directory.com/expostars/index.php 而不是您的脚本,所以您需要代理所有请求
-
@MichailStrokin 任何提示如何代理,我不是太专家。我只是不想浪费我的全部工作。谢谢
-
表单是通过其他站点的ajax提交,还是通过默认浏览器表单提交?您肯定需要链接代理,以便每个链接都指向您的服务器以获取从外部站点提取的新版本以进行呈现
-
@charlietfl 没有它的简单请求,没有 ajax
-
我现在添加一个新答案
标签: php jquery html css iframe