Warning: Unknown()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vchris
Forum Contributor
Posts: 204
Joined: Tue Aug 30, 2005 7:53 pm
Location: Canada, Quebec

Warning: Unknown()

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you're using sessions in an "odd" old bug related way.
vchris
Forum Contributor
Posts: 204
Joined: Tue Aug 30, 2005 7:53 pm
Location: Canada, Quebec

Post 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();
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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..
vchris
Forum Contributor
Posts: 204
Joined: Tue Aug 30, 2005 7:53 pm
Location: Canada, Quebec

Post 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;
Post Reply