Delay redirection in php

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
jplus2
php-forum Fan User
php-forum Fan User
Posts: 87
Joined: Wed May 16, 2012 4:17 pm

Thu May 17, 2012 11:14 pm

Hola guys

you know how to delay redirection in php?
like displaying an info first before going to be redirected

header function i guess

Thank you in advance guys
User avatar
smarjit
php-forum Fan User
php-forum Fan User
Posts: 72
Joined: Wed Feb 02, 2011 10:18 pm

Thu May 17, 2012 11:26 pm

You can use the javascript setTimeout function

setTimeout(function() { code to redirect ; }, time_interval in millisecond);

Thanks
Smarjit
User avatar
minimihi
php-forum GURU
php-forum GURU
Posts: 236
Joined: Sat Apr 14, 2012 11:57 am
Location: Vilnius, Lithuania

Sat May 19, 2012 2:46 am

Its not possible in PHP
User avatar
macek
php-forum GURU
php-forum GURU
Posts: 277
Joined: Wed Aug 25, 2010 10:42 am
Contact:

Sun May 20, 2012 8:31 am

<?php
header( "refresh:5;url=wherever.php" );
echo 'You\'ll be redirected in about 5 secs. If not, click <a href="wherever.php">here</a>.';
?>
jplus2
php-forum Fan User
php-forum Fan User
Posts: 87
Joined: Wed May 16, 2012 4:17 pm

Sun May 20, 2012 4:32 pm

Thanks for the help guys!

Thanks macek, I will try this out.
Post Reply