Welcome Guest, Not a member yet? Register   Sign In
Load view from url, dangerous ?
#5

[eluser]Référencement Google[/eluser]
So far I have now :
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Page extends MY_Controller {

    public $allowed_views = array('index', 'about'); // List of allowed pages
    
    /**
     * Page Constructor
     *
     * @access    public
     */
    public function __construct()
    {
        parent::__construct();
    }
    
    // --------------------------------------------------------------------

    /**
     * Remaping all requests
     *
     * @page    string    The page name
     * @access    public
     */
    public function _remap($page = false)
    {                                
        // Let's make sure this page is allowed to view
        if(in_array($page, $this->allowed_views, true))
        {
            $this->load->view('pages/'.$page);
        }
        else
        {
            show_404();
        }
    }
    
}

/* End of file page.php */
/* Location: ./application/controllers/page.php */


Messages In This Thread
Load view from url, dangerous ? - by El Forum - 12-19-2009, 11:11 AM
Load view from url, dangerous ? - by El Forum - 12-19-2009, 12:13 PM
Load view from url, dangerous ? - by El Forum - 12-19-2009, 12:21 PM
Load view from url, dangerous ? - by El Forum - 12-19-2009, 01:41 PM
Load view from url, dangerous ? - by El Forum - 12-19-2009, 01:57 PM
Load view from url, dangerous ? - by El Forum - 12-20-2009, 10:35 PM
Load view from url, dangerous ? - by El Forum - 12-21-2009, 03:33 AM
Load view from url, dangerous ? - by El Forum - 12-21-2009, 03:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB