CodeIgniter Forums
Redirect with delay - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Redirect with delay (/showthread.php?tid=20666)



Redirect with delay - El Forum - 07-17-2009

[eluser]Unknown[/eluser]
dear all....

i want to make a redirect url with some delay likes this site where i just click advanced search, i have read discussion in this forum: http://ellislab.com/forums/viewthread/86374/
but there is no delay to direct to another url...

any help me??

sorry about my english language..


Redirect with delay - El Forum - 07-17-2009

[eluser]Cro_Crx[/eluser]
In your view just have something like this near the top in the header.

Code:
<?php if(isset($redirect)): ?>
    <meta http-equiv="refresh" content="<?=$redirect['timer']?>?>;url=<?=site_url($redirect['url']?>" />
<?php endif; ?>

Then when you call it just pass in some info.

Code:
$data['refresh']['timer'] = 5;
$data['refresh']['url'] = 'some_uri';
$this->load->view('the_view', $data);



Redirect with delay - El Forum - 08-13-2009

[eluser]spmckee[/eluser]
It looks like you're using two different variable names there; "refresh" and "redirect".


Redirect with delay - El Forum - 08-14-2009

[eluser]Cro_Crx[/eluser]
whoops, yeah you are right. I think I was in a rush while answering the question. Either redirect or refresh is fine i suppose.

Thanks for pointing that out.