Welcome Guest, Not a member yet? Register   Sign In
[solved] die() function
#1

[eluser]tuckee[/eluser]
I am trying to achieve a function that checks if a person has login. if they do not, it will not run the function and just show an error message.

below is my function that check if the user has successfully login by checking session.
Code:
function check_user()
{
$logged_in_type = $this->session->userdata('type'); //retrieve data from session
if ($logged_in_type == '')
{
  $data['heading'] = 'Sorry!';
  $data['content']="You do not have permission to access this page. Please return to homepage <a href='http://example.com'>Here</a>";
  $this->load->view('general_view', $data);
  
  
  die();
}
}

yes, it does check, and the function did not run. but it shows blank page. it did not load the view 'general_view' page that contents the error message.

any idea any alternative way of doing it?

many thanks



Messages In This Thread
[solved] die() function - by El Forum - 01-19-2012, 03:50 AM
[solved] die() function - by El Forum - 01-19-2012, 03:59 AM
[solved] die() function - by El Forum - 01-19-2012, 04:02 AM
[solved] die() function - by El Forum - 01-19-2012, 04:38 AM
[solved] die() function - by El Forum - 01-19-2012, 05:06 AM
[solved] die() function - by El Forum - 01-19-2012, 07:42 AM
[solved] die() function - by El Forum - 01-19-2012, 12:03 PM
[solved] die() function - by El Forum - 01-19-2012, 04:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB