Forum Moderators: coopster
To resolve this PHP notice issue I figured no big deal I will just declare the variable as a constant using define(). But by doing this correct me if I'm wrong you now no longer refer to the variable with a dollar sign and the variable name. Which is fine but can I store the constant into the session file?
My concern and question is what the best direction to resolve this? At present if I just define the variables as a constant I get another PHP message "Notice: Undefined offset..." throughout my code when referencing my session variable (_SESSION[name]).
Any advice would be greatly appreciated.
When the user login and is valid you set a bunch of sessions variable like ($_SESSION['securitylevel1'])
After that do you define constants for a few of those like this:
define("SECURITY_LEVEL_1", $_SESSION['securitylevel1']);
As long as the define statements precede any code where you use the constants, it should work.
like if (SECURTITY_LEVEL_1 > 10)
hope I'm not too off track
mavherick