Welcome Guest, Not a member yet? Register   Sign In
if on session->userdata()

hi all i am tryng to make my pages reserved ,so i'm setting userdata('admin');
after a login action into a login.php controller

but when i redirect after login to my other controller user.php i have to make a selection like this to make it reserved:
if(! $this->session->userdata('admin'))

this code should be incorrect beacause always after login(TRUE validation) i come back to login.php instead of been redirected to home.php

is not a problem of redirecting and there is any other problem

maybe i need a better way to say this:

if(! $this->session->userdata('admin'))

How can i write in a better way this if() function?

did anyone can help me?

thanks guys


if login ok
redirect(your homepage)

Create a MY_Controller and add a function check_login(()

Then extend all your controllers from the MY_Controller


Read Phil's Article here


Theme © iAndrew 2016 - Forum software by © MyBB