【问题标题】:PHP Form post inside iframe not workingiframe内的PHP表单帖子不起作用
【发布时间】:2014-11-10 18:31:27
【问题描述】:

我有一个托管在 abc.com 上的网站,其中包含一个简单的表单

<form action="./" method="post">
    <div>
        <input type="submit" readonly="true" placeholder="tempemail123" name="getemail" value="Create Temporary Email" />

    </div>
        <div>
          <input type="email" class="form-control disposable-text-field" id="email" placeholder="tempemail123@example.com" readonly="true">
        </div>

    </form>

上述表格运行良好。

我还有另一个网站 https://www.xyz.com,我将上面的内容嵌入到 iframe 中

<iframe src="https://www.abc.com"></iframe>

但这不适用于 chrome 和 firefox 浏览器。 (它在 safari 上工作)当我查看网络请求时,我看到 https://www.abc.com/ 的帖子显示 'cancelled' 。这有什么原因不能在 chrome 上运行吗?

【问题讨论】:

    标签: javascript php google-chrome iframe


    【解决方案1】:

    在表格中输入target='_parent'

    【讨论】:

    • 把这个留给那些通过谷歌搜索找到解决方案的人。如果您在表单中将target="_parent" 作为属性放置,则提交将起作用,但不会将其全部保留在 iframe 中,而是会在普通选项卡(同一个选项卡)中打开它。
    猜你喜欢
    • 2011-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-17
    • 2018-10-16
    • 2014-09-09
    • 2016-10-26
    • 1970-01-01
    相关资源
    最近更新 更多