The piece of code simply create login and logout buttons with sessions in PHP.
<?php
$log=$this->session->userdata("email");
if(!$log)
{
echo anchor('Login path', 'Login', 'title="login"');
}
else
{
echo anchor('Logout path', 'Logout', 'title="logout"');
}
?>
<?php
$log=$this->session->userdata("email");
if(!$log)
{
echo anchor('Login path', 'Login', 'title="login"');
}
else
{
echo anchor('Logout path', 'Logout', 'title="logout"');
}
?>
No comments:
Post a Comment