header location delay

前端 未结 7 1959
攒了一身酷
攒了一身酷 2020-12-06 02:49

I have the following php code which I want to add a delay too:



        
7条回答
  •  北海茫月
    2020-12-06 03:36

    You won't be able to see the message if you're using a header(Location) redirect. In fact, that redirect shouldn't work at all since output starts before the headers are sent. Instead, you should echo a meta tag refresh with a delay, like this echo '';

    which will have a delay of five seconds. Alternatively, (and more properly) you could output a JS redirect, as the meta refresh tag is deprecated.

提交回复
热议问题