Welcome Guest, Not a member yet? Register   Sign In
someone please take a look at my setup
#1

[eluser]AtlantixMedia[/eluser]
Hello,

can someone please take a look at my code and tell me what's wrong with it? thanks

master.php
Code:
<?php

class Master extends Controller {

    //===============================================
    function Master()
    //===============================================
    {
        parent::Controller();

     }
    
}
?>

tracking.php
Code:
<?php
include(APPPATH . 'controllers/access/master.php');

class Tracking extends Master {


    function Tracking()
    {
        parent::Master();

    }


}
?>

neutral.php
Code:
<?php
include(APPPATH . 'controllers/access/tracking.php');

class Neutral extends Tracking {
      
    function Neutral()
    {
        parent::Tracking();

    }
    
}
?>

searchmaster.php
Code:
<?php
include(APPPATH . 'controllers/access/neutral.php');

class SearchMaster extends Neutral {

    //===============================================
    function SearchMaster()
    //===============================================
    {
        parent::Neutral();
        $this->load->model('Search_Model');        
        if ($this->_SearchIntervalOk() == false)    //do IP check here and limit subsequent searches to >30 secs
        {
                echo 'check';
        Admin(39, SefUrl('src-adv', 'url'));
        exit;
        }
    }

    
    //===============================================
    function _SearchIntervalOk()
    //===============================================
    {
    $interval = $this->GLOBAL_UTC - $this->config->item('SearchWaitTime');
    return ($this->Search_Model->CheckSearchInterval($this->GLOBAL_IP, $interval) > 0)    ?    false    :    true;
    }    
    
    
}
?>

main.php
Code:
<?php
include(APPPATH . 'controllers/search/searchmaster.php');

class Main extends SearchMaster {

    //===============================================
    function Main()
    //===============================================
    {
        parent::SearchMaster();
        $this->perPage = $this->config->item('DefaultUserListPerPage');        
    }

    //===============================================
    function index()
    //===============================================
    {
    $this->Advanced();
    }

    //===============================================
    function Advanced()
    //===============================================
    {
        
    }

    //===============================================
    function HandleSearch()
    //===============================================
    {
        echo 'search';
        }
}
?>

Ok, first of all, I'm using this setup successfully in other parts of my application. Then, when main->handlesearch() is called, whatever is in searchmaster constructor should be run first. this happens all the time in other parts of the application. However, in this particular situation, when main->handlesearch is called, it first executes whatever is in that function. THEN, it does whatever is in searchmaster constructor.

someone please help. thanks




Theme © iAndrew 2016 - Forum software by © MyBB