Welcome Guest, Not a member yet? Register   Sign In
Countdown before redirecting to a page
#1

[eluser]selman555[/eluser]
Hello everyone!

Question: I've been looking for a simple way to redirect users back to the homepage when they have successfully logged in.

I know about this:
Code:
$this->output->set_header('refresh:5; url='.base_url());

This should delay my request for five seconds, but it doesn't Confused
I would also like to output the remaining seconds like this:

You will be redirected in $timeRemaining seconds.

How can I accomplish this? If someone knows a way without codeigniter, that would be fine too.
#2

[eluser]Bhashkar Yadav[/eluser]
Note: If a file is cached, headers will not be sent.
#3

[eluser]selman555[/eluser]
[quote author="Bhashkar" date="1327429241"]Note: If a file is cached, headers will not be sent.[/quote]

I don't think this involves cached files, or does it?
#4

[eluser]Bhashkar Yadav[/eluser]
could you please check it with PHP's header function like :
Code:
header( "refresh:5;url=base_url()" );
#5

[eluser]Aken[/eluser]
Any particular reason why you want this functionality? An immediate redirect is fairly commonplace amongst websites requiring logging in.




Theme © iAndrew 2016 - Forum software by © MyBB