CodeIgniter Forums
Redirect after 3 seconds - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Redirect after 3 seconds (/showthread.php?tid=9019)



Redirect after 3 seconds - El Forum - 06-09-2008

[eluser]eyupci[/eluser]
Hi there,

I'm newbie in CI. I have a dumb question.

Can I redirect page after 3 seconds with using redirect function in CI.

thanks


Redirect after 3 seconds - El Forum - 06-09-2008

[eluser]tchule[/eluser]
Hello,

The redirect should be launched from the client side I think.

You should do something like this in javascript (in the head section) :

Code:
function redirect(page) {
[removed]=page;
}

setTimeout('redirect("http://mypage/")',5000);

Tchule


Redirect after 3 seconds - El Forum - 06-09-2008

[eluser]richthegeek[/eluser]
you could always use the usleep php command to pause the script for 3 seconds... not the most elegant solution but w/e...


Redirect after 3 seconds - El Forum - 06-09-2008

[eluser]Michael Wales[/eluser]
Don't ignore the most simple solutions.


Redirect after 3 seconds - El Forum - 11-21-2008

[eluser]Iverson[/eluser]
[quote author="Michael Wales" date="1213043381"]Don't ignore the most simple solutions.[/quote]

Yeah but I think he was wanting to use CI's redirect function. I'm having the same issue. redirect() should have a parameter for seconds if you're using the refresh method.


Redirect after 3 seconds - El Forum - 06-23-2010

[eluser]mashary[/eluser]
that's right, redirect function should have a paramenter redirect(4) direct in 4 sec. hope someone develop