Redirect with Timer in PHP?

前端 未结 11 2058
刺人心
刺人心 2020-12-28 11:49

How can I make a redirect with PHP after say 10 seconds...

I have read alot about it, seems like it would be better with javascript. But PHP would save me alot of co

11条回答
  •  伪装坚强ぢ
    2020-12-28 12:15

    Another method worth mentioning is sending a Location HTTP header with PHP's header() function. So, if you want a robust solution that avoids javascript and meta tags, while keeping web application responsive, that might be creating an iframe (or a frame) and loading there a php script that contains the following:

    sleep(10);
    header("Location: http://my.redirect.location.com");
    

提交回复
热议问题