Welcome Guest, Not a member yet? Register   Sign In
How to verify a session in the view? It is possible?

[eluser]Tomer Simis[/eluser]
I'm creating a site with a login panel, and when the user log on, it would display a message, but i dont know how to do this in CodeIgniter.

In normal PHP, its like this:

    echo '<p>You are logged.</p>';
        if($_SESSION['type'] == 'admin'){
        echo  '<p>Im a admin</p>';
    echo '<p>You are not logged.</p>';

but in codeigniter its hard, can i check the session in the view? or i need to pass the status from the controller?

Please, help me guys

In normal CI, its like this: Smile
if ($this->session->userdata('login'))
    echo '<p>You are logged.</p>';

[eluser]Tomer Simis[/eluser]
It works =DD
Thanks very much!!!

Theme © iAndrew 2016 - Forum software by © MyBB