View Single Post
  #6 (permalink)  
Old June 15th, 2009, 07:32 PM
blackhorse66 blackhorse66 is offline
Authorized User
Points: 133, Level: 2
Points: 133, Level: 2 Points: 133, Level: 2 Points: 133, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default error_reporting E_ALL

Quote:
Originally Posted by alanphil View Post
Found the problem -- in the Welcome controller you need to make sure that you have "session_start();". I think this is an oversight in the book.
Alan
But the
Code:
 function Welcome(){
    parent::Controller();
    session_start();
    $this->output->enable_profiler(FALSE);
  }
already make sure that you have "session_start();". So that shouldn't be the problem, should it be?

I think it is due to the index.php set up the error report as E_NOTICE.

The codes should be working fine if Error reporting is "E_ALL & ~E_NOTICE".

To make the codes working for "E_NOTICE"

We need to make the codes like

Code:
  if (! isset($_SESSION['userid']) || ($_SESSION['userid'] < 1)) {
    redirect('welcome/verify','refresh');
  }
But it is kind redundancy to always check isset for $_SESSION['userid']?

What is really the problem?

What should we do, change the error reporting in index.php to "E_ALL & ~E_NOTICE" or modify the codes such as from

Code:
  if ($_SESSION['userid'] < 1) {
    redirect('welcome/verify','refresh');
  }
to

Code:
  if (! isset($_SESSION['userid']) || ($_SESSION['userid'] < 1) ){
    redirect('welcome/verify','refresh');
  }
?

If for error reporting E_NOTICE, there are too many codes requiring modification.

Last edited by blackhorse66; June 15th, 2009 at 07:51 PM..
Reply With Quote