I'm having one hell of a time trying to firgure out this error I'm recieving, __PHP_Incomplete_Class Object, which I'm sure most have encountered before.. Here's the break down.
once authenticated: header('Location: admin.php');
//create log from flat file
log = new log($name, $database);
//test log was created successfully, and it is
I can't seem to understand this error, considering there is no object manipulation and everything is seemingly sequential (class definitions before session_start, etc.)
//test object integrity
print_r($_SESSION['log']); //This yields _PHP_Incomplete_Class Object
Why do you not session_register() on the second page? The whole session_register() thing was always strange to me, and I think the behaviour of that changed a couple years ago. It *seems* (and this is how I was teaching it a couple years ago IIRC) that if you use $_SESSION, just use that all the time - don't bother doing the session_register() stuff.
In the first one, don't session_register - just do $_SESSION['log'] = ... and see how that works.
Oh wow - I see you're from Ann Arbor - I just moved from there! Used to run the sempug (PHP user group). There's still a sempug list at yahoogroups.com if you are looking to meet up with other PHP users in the area. :)
unfortunately, this does not resolve the problem. I can't figure out how on one page it can be complete and then after a redirection, it isn't complete. I also can't believe that no one else has anything to say about this error. I'm sure almost everyone has had to deal with it.
ok...so I figured it out...
don't use "session_start()" within a class definition
take care of some notices from PHP Manual:
If you want your script to work regardless of register_globals, you need to instead use the $_SESSION array as $_SESSION entries are automatically registered. If your script uses session_register(), it will not work in environments where the PHP directive register_globals is disabled.
register_globals: important note:
Since PHP 4.2.0, the default value for the PHP directive register_globals is off. The PHP community encourages all to not rely on this directive but instead use other means, such as the superglobals.
If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered(), and session_unregister().