clonetrooper9494 Posted January 3, 2009 Share Posted January 3, 2009 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 0A long, confusing error, and its talking about stuff I have never heard of. I read up, and I think I may have a problem. It seems my host got the latest version of PHP, and now this error pops up. It is probably because of these lines: $conf_password = isset($_POST['conf_password']) ? trim($_POST['conf_password']) : ''; $email = isset($_POST['email']) ? trim($_POST['email']) : ''; $gender = isset($_POST['gender']) ? trim($_POST['gender']) : ''; $birthday = isset($_POST['birthday']) ? trim($_POST['birthday']) : ''; $image = isset($_POST['image']) ? trim($_POST['image']) : ''; $info = isset($_POST['info']) ? trim($_POST['info']) : '';... $_SESSION['email'] = $_POST['email']; $_SESSION['info'] = $_POST['info']; $_SESSION['image'] = $_POST['image']; $_SESSION['gender'] = $_POST['gender']; $_SESSION['birthday'] = $_POST['birthday']; Now the thing is that I don't think that I can set setting session.bug_compat_42 or session.bug_compat_warn to off. My site is hosted on a server, so how can I stop this error from showing? Should I rewrite the script so its like $_SESSION['session_email'] = $_POST['post_email'];? Or is there some variable I can disable?EDIT: the title is kind of long... oops Link to comment Share on other sites More sharing options...
Wander Posted January 3, 2009 Share Posted January 3, 2009 not sure what exactly causes the problem, but first u say:$email = isset($_POST['email']) ? trim($_POST['email']) : '';and later:$_SESSION['email'] = $_POST['email'];shouldnt that be:$_SESSION['email'] = $email;do you use session_register() anywhere in ur code? Link to comment Share on other sites More sharing options...
clonetrooper9494 Posted January 3, 2009 Author Share Posted January 3, 2009 I just realized I did that. I fix it after this problem is resolved.Why would I use session_register()? It says using session_register() should be avoided. Is there any way to stop the errors?I fixed the problem by saying this: $conf_password1 = isset($_POST['conf_password']) ? trim($_POST['conf_password']) : ''; $email1 = isset($_POST['email']) ? trim($_POST['email']) : ''; $gender1 = isset($_POST['gender']) ? trim($_POST['gender']) : ''; $birthday1 = isset($_POST['birthday']) ? trim($_POST['birthday']) : ''; $image1 = isset($_POST['image']) ? trim($_POST['image']) : ''; $info1 = isset($_POST['info']) ? trim($_POST['info']) : ''; It seems that the sessions vars had nothing to do with it. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 14, 2009 Share Posted January 14, 2009 You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.The warning happens when you use a bunch of variables with the same names, e.g. $email, $_SESSION['email'], $_POST['email'], etc. Set the config option if you want to disable the warning. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.