gpt4 book ai didi

php - 无需使用 javascript 将 POST 页面加载到 <iframe>

转载 作者:行者123 更新时间:2023-11-28 03:55:12 26 4
gpt4 key购买 nike

this question解决了“使用 JavaScript 发布到 iframe”的问题。

My scenario:

I am not allowed to use JavaScript or any of its libraries. Only thing I can use is PHP and HTML.

  • Page1.php:

       <form action="Page2.php">
    <input type=".... >
    .
    .
    .
    </form>
  • Page2.php:

       <iframe src="http://externalsite.com/post-to-this-address-thru-iframe">
    </iframe>

当使用 JavaScript 时,这总是可能的。使用 curl 等 PHP 的 post 函数也不行。真的有适合我的光源吗?

最佳答案

根据我的评论。

  1. 将名称属性添加到您的 iframe。
  2. 将表单的目标设置为 iframe 的名称。

http://jsfiddle.net/gRoberts/GZPqM/

注意 - 似乎 JSFiddle 不喜欢你在他们的网站上发帖,因此你会得到一些奇怪的 JSON 输出。

关于php - 无需使用 javascript 将 POST 页面加载到 &lt;iframe&gt;,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11950590/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com