|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-10-22 03:55 UTC] martyn dot griffin at charter dot net
Description:
------------
Using Fedora 5 and yum updated from PHP 5.1.4 to PHP 5.1.6
After completetion of update, I have lost access to all of my $_SERVER values. They disappear right after assigning them in every script I use, which has crippled my current application
Reproduce code:
---------------
<?PHP
// index.php
include_once('script/funcs.php');
setTheme('default');
echo 'BG Color-->'.$_SERVER['thmBGcol'];
?>
<?PHP
// funcs.php
function setTheme($thm)
{
$_SERVER['thmBGcol'] = "#000066";
}
Expected result:
----------------
I expect the following line to be echoed:
BG Color-->#000066
instead I get
BG Color-->
Actual result:
--------------
instead I get
BG Color-->
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 29 13:00:01 2025 UTC |
I owe all an appology - it must have been a senior moment!! The issue applies to using $_SESSION not $_SERVER, so please change that in all my references. I have the following set (or defaulted) in php.ini register_globals = Off register_long_arrays = Off register_argc_argv = Off variables_order = "EGPCS" This was not changed since running 5.1.4 when the application functioned as expected. Also, the example to reproduce the problem should be altered in the included code as: <?PHP // index.php include_once('script/funcs.php'); setTheme('default'); echo 'BG Color-->'.$_SESSION['thmBGcol']; ?> <?PHP // funcs.php session_start(); $_SESSION['BASE'] = 'default'; function setTheme($thm) { $_SESSION['thmBGcol'] = "#000066"; } ?> Every page used starts with the include for funcs.php.