mardi 23 février 2016

php if statement probelm all condition approve

i check a condition in my script but have problem with if statement check my code

   function __construct($user=null)
    {
        parent::__construct();
        require_once 'model/chanell_model.php';
        $this->theme->msg='.....';
        $this->db = new chanell_model();
        if ($user==null && !parent::isLog()){
            $this->themes=2;
        }elseif ($user===null){
            echo 'print';
        $this->db->getChanellData();

        }elseif($user!==null){
            echo 'print';

        }else{

            $this->db->getChanellData($user);
        }


    }

how could be possible in same time $user==null and also $user!=null. in this code both echo command will work .

i also use == instead of === .

sorry for my english.

Any help would be great.

Aucun commentaire:

Enregistrer un commentaire