yoshida Posted April 7, 2006 Share Posted April 7, 2006 I get this error when I save a variable to a session, what does it mean and what should I do? Warning: Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0I use PHP 4.4.2. Variables are saved to a session using $variable=$_POST['fieldname'];session_register('fieldname'); and read from a session using $variable=$_SESSION['fieldname'] When I refresh the page all is OK and everything works fine, but this is just anoying. Do I use the wrong syntax for this PHP version, or should I adapt a config file for PHP or Apache? Please help me. I try my very best to understand how php programming works.EDIT: got it. session_register is (unsafe) old school. I use the new way right now, which I can't look up at the moment. No errors for now. Link to comment Share on other sites More sharing options...
klapy Posted April 8, 2006 Share Posted April 8, 2006 I never had this error, but you might want to try it without using session_register()Just use $_SESSION = ;edit:Ah you discovered that already Link to comment Share on other sites More sharing options...
dcole.ath.cx Posted April 8, 2006 Share Posted April 8, 2006 make sure register_globals = On in your php.ini Link to comment Share on other sites More sharing options...
yoshida Posted April 10, 2006 Author Share Posted April 10, 2006 I never had this error, but you might want to try it without using session_register()Just use $_SESSION = ;edit:Ah you discovered that already <{POST_SNAPBACK}> Like this? $_SESSION['ctyp'] = $ctyp; @dcole: did that, disregarding the config file's warning. Meh, it's just an intranet solution, so who cares. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now