• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.