PHP Header redirect to Multiple URLs with a time gap

前端 未结 5 1840
北恋
北恋 2020-12-10 23:11

Can i use header() to redirect to multiple URLs with a time gap in between? Suppose i have url1 and url2. Now, what i want is that header first redirects to url1. Then say,a

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 23:59

    No, you can't do that. Both headers are immediately sent to the browser, with the latter one overwriting the first one. You can add "Refresh: X" before the url, but it will only work for the last header sent (the URL that will get redirected to).

    Actually I don't see any way to accomplish this unless you control what is on url1 or use some tricks with frames.

提交回复
热议问题