关闭
dongzuoyue6556 2017-08-24 18:17
浏览 110
已采纳

在html中加载简单的嵌入iframe,然后在php重定向

I know this question was asked before, but the answer was not 100% clear. I have a very simple html page that loads an iframe, I want after this, to load a simple php redirection.

so i did:

<iframe width="1" height="1" src="http://cookie.com"></iframe>
<?php
header("Location: https://example.com);
exit();
?> 

I supposed that put a header("Location right after the embed iframe would work, but the page never redirects due to the load of the iframe. What would be the right way to do this?

  • 写回答

1条回答 默认 最新

  • doutong2132 2017-08-24 20:12
    关注

    I do not see why you would load the iframe and leave the page. In your header("Location: https://example.com), you did not close the quotation mark.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部