Welcome Guest, Not a member yet? Register   Sign In
Any Help Appreciated (Rerouting/Remapping) :)
#4

[eluser]Lewis Cowles[/eluser]
Hi there,

It sounds like you have a square peg and a round hole. If for example you changed from using your index page to another method, it can take the parameters as url variables; Using these parameters to query the database seems like a simple solution to me, if your goal was to build those pages from the database.

You do need to be careful to build a solid abstraction layer however, because otherwise unscrupulous individuals may find exploits to query alternative data from your systems database. Also an open-ended system like this can have lots of holes and flaws so really, I wouldn't advise it.

Code:
function dbpage($field,$constraint1,$constraint2)
{
    $chk = $this->db->get_where('dbpages',array('somecolumn'=>$constraint1,'anothercolumn'=>$constraint2));
    if($chk->num_rows == 1) // valid, now build page
    {
        //do stuff here
    }
}

Btw these methods can be used for /admin or /anything really as the methods live inside the main controller, be careful though, there is not much more reason to having one of these than having another controller


Messages In This Thread
Any Help Appreciated (Rerouting/Remapping) :) - by El Forum - 07-31-2012, 01:52 PM
Any Help Appreciated (Rerouting/Remapping) :) - by El Forum - 07-31-2012, 02:05 PM
Any Help Appreciated (Rerouting/Remapping) :) - by El Forum - 07-31-2012, 02:07 PM
Any Help Appreciated (Rerouting/Remapping) :) - by El Forum - 07-31-2012, 02:07 PM



Theme © iAndrew 2016 - Forum software by © MyBB