Question #755   Submitted by Answiki on 10/26/2021 at 12:09:16 PM UTC

With PHP, how to redirect page after 5 seconds?

Answer   Submitted by Answiki on 10/26/2021 at 12:10:32 PM UTC

In PHP scripts, the best way redirect after a given amount of time is to specify the HTTP header with the function header() :

header( "refresh:5;url=https://www.example.com" );

The above example redirect to https://www.example.com after 5 seconds.

6 events in history
Question by Answiki 10/26/2021 at 12:13:44 PM
With PHP, how to redirect after 5 seconds?
Question by Answiki 10/26/2021 at 12:10:58 PM
How to redirect after x seconds in PHP?
Question by Answiki 10/26/2021 at 12:10:53 PM
How to redirect after N seconds in PHP?
Question by Answiki 10/26/2021 at 12:10:47 PM
How to redirect after 5 seconds in PHP?
Answer by Answiki on 10/26/2021 at 12:10:32 PM

In PHP scripts, the best way redirect after a given amount of time is to specify the HTTP header with the function header() :

header( "refresh:5;url=https://www.example.com" );

The above example redirect to https://www.example.com after 5 seconds.

Question by Answiki 10/26/2021 at 12:09:16 PM
With PHP, how to redirect page after 5 seconds?
# ID Query URL Count
0 7298 https://fr.ans.wiki/755/comment-nomme-minus-t-minus-on-les-habitants-de-l-espagne/ https://en.ans.wiki/755/with-php-how-to-redirect-page-after-5-seconds 1
1 6775 comment appelle t'on les habitants de l'Espagne https://en.ans.wiki/755/with-php-how-to-redirect-page-after-5-seconds 1

Icons proudly provided by Friconix.