View Single Post
  #1 (permalink)  
Old November 4th, 2008, 05:10 PM
alanphil alanphil is offline
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with login logic and Dashboard

I'm having problems with the login logic that starts on page 150 in the book. The verifyUser function on this page includes the following:

if (Q->num_rows() > 0) {
   $row = $Q->row_array();
   $_SESSION['userid'] = $row['id'];
   $_SESSION['username'] = $row['username'];

etc.

On page 153, in the function Dashboard, the author adds the following statement:

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

After I add the code above and attempt to log into the Dashboard, I get the following PHP Error in the browser:

Message: undefined index: userid
Filename: admin/dashboard.php

I've tried everything I can think of to fix this, but still stuck. Any insight into this problem would be greatly appreciated.

Thanks!
Alan





Reply With Quote