Refresh page in time interval

Asked

Viewed 992 times

3

I need to set the goal:

meta http-equiv="refresh" content="30"

However I am using Codeigniter and I can’t do it. I tried:

$this->output->set_header('refresh:30;url=minhapagina.php');

Any suggestions?

1 answer

2

Right in your View you can even configure whether you need it or not! Thus

public function index(){
        $data['stsRefresh'] = true;
        $this->load->view('Arquivos/index', $data);
}

And in your View

<html>
<head>
<title>Upload Form</title>
</head>
<body>
<?php
    if (isset($stsRefresh)){
        echo '<meta http-equiv="refresh" content="300">';
    }
?>
<form action="/arquivos/do_upload" method="post" enctype="multipart/form-data">
<input type="file" name="userfile" size="20" />

<br /><br />

<input type="submit" value="upload" />

</form>

</body>
</html>

Reference

Browser other questions tagged

You are not signed in. Login or sign up in order to post.