dqsxsmi3704 2015-05-01 15:00
浏览 27

从表单获取GET数据的iFrame加载了错误的源代码

So I have a site example.com/search.php which has an iFrame in it like so:

<iframe src='http://anotherdomain.com/form.php' name='iframeform'></iframe>

My site also has a sidebar with a little form that is supposed to pass data to the iFrame in mydomain.com/search.php. I used the forms target attribut for that like so:

<form action="http://example.com/search.php" target="iframeform" method="get">

When I submit the form the page example.com/search.php is loaded as expected. However, the iFrame does not load the external URL, but instead it also loads example.com/search.php. The iFrame within the iFrame loads the external URL.

So what I would like to achieve is to submit my sidebar form and send the data to the iFrame. But the iFrame loads the wrong source, the same site instead of the external URL.

EDIT: to clear this up a bit. A form on site1.php sends data to site2.php. On site2.php is an iFrame with its source set to an external URL example.com/search.php. I want the data from site1.php to be passed to the iFrame in site2.php; I used the form's target attribute for that.

When I submit the form the browser loads site2.php, as you would except, but the iFrame ALSO loads site2.php instead of the external URL, which doesn't really makes sense to me. So what I get is site2.php in the browser, which has an iFrame that loads site2.php which again has an iFrame...

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?
    • ¥15 c++头文件不能识别CDialog