Page 1 of 1

Warning: Unknown()

Posted: Wed Sep 28, 2005 8:33 pm
by vchris
What does this mean?
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 0

Posted: Wed Sep 28, 2005 8:40 pm
by feyd
you're using sessions in an "odd" old bug related way.

Posted: Fri Sep 30, 2005 6:31 pm
by vchris
It started since I defined a new session variable which I use for my delete page.

Code: Select all

$_SESSION['teamid'] = $row['teamid'];
Then what I do is a redirect to the admin page with a certain query string that includes that "teamid".

Code: Select all

$url .= '/teams_admin.php?team=' . $_SESSION['teamid'];
			
			header("Location: $url");
			$_SESSION['teamid'] = null;
			exit();

Posted: Fri Sep 30, 2005 6:47 pm
by feyd
try using unset() instead of setting to null.. I've never recieved the error/warning personally, so I can't be too sure how to reproduce it..

Posted: Fri Sep 30, 2005 7:04 pm
by vchris
Fixed!

it's because I am using a session variable in a query string. I created a variable with same value as session variable and works.

Code: Select all

$teamid = $_SESSION['teamid'];
$url .= '/teams_admin.php?team=' . $teamid;