Welcome Guest, Not a member yet? Register   Sign In
hook doesn't redirect me
#1

Hi everyone,

(Sorry for my english)

I try to use hooks... It works but I've a small problem.

I said to my hook: IF condition OK -> do...

but I would like : IF condition not OK -> continue

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Maintenance extends CI_Controller {
 
   public function index ()
   {
       $this->CI =& get_instance();
       
       $this->CI->options_params = $this->CI->m_options->get_options();
       
       $off   = new DateTime($this->CI->options_params[0]->off_ligne);
       $today = date("Y-m-d H:i:s");
       $now   = new DateTime($today);
       $interval = $now->diff($off);
       $decal    = $interval->format('%a');
       $signe    = $interval->format('%R');
       
         if ($this->CI->options_params[0]->maintenance == 1 && $this->config->item('acces')[$_SERVER['mail']] === 'admin')
         {
             if ($signe === "-")
             {
                 
                 echo "<div> TOTO </div>";
             }
         }
     
   }
   
}

When the condition is ok... it's good, the message is displayed and the application doen't continue...
but when the condition is not ok... I've a blank page ... I would like that the application continue normaly.

Someone to help me ?
Thanks
Marc
Reply


Messages In This Thread
hook doesn't redirect me - by Cognie - 03-19-2018, 05:29 AM
RE: hook doesn't redirect me - by Narf - 03-19-2018, 08:28 AM
RE: hook doesn't redirect me - by Cognie - 03-20-2018, 12:32 AM
RE: hook doesn't redirect me - by InsiteFX - 03-20-2018, 04:18 AM
RE: hook doesn't redirect me - by Cognie - 03-20-2018, 04:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB