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!
var $text = array (
'CONTRACT_ID' => array
(
'est' => '*Contract ID*',
'eng' => 'Contract ID',
),
'CUSTOM_COMMENT' => array
(
'est' => '*Custom Comment*',
'eng' => 'Custom Comment',
),
'STATUS' => array
(
'est' => '*Status*',
'eng' => 'Status',
),
'NEW_CONTRACT' => array
(
'est' => '*New Contract*',
'eng' => 'New Contract',
),
);
function DoL($change)
{
if (isset($_SESSION['lang']))
{
//this next line is where it explodes
if(isset($this->text[$change][$_SESSION['lang']]))
{
echo $this->text[$change][$_SESSION['lang']];
}
}
else
{
trigger_error('No Language Set', E_USER_ERROR);
}
}
the array is supra much huger than that but you get the idea. It does this where everywhere that i use that function but it only does it randomly, i think maybe when i hit the back button a few times but maybe not. wtf does this mean!?
shwat?! what are these indexes you speak of and whatnot? its not null i am not using null for anything
and i just tested and it dosn't matter what im doing it just happens for no reason, like go to the same exact link that i am viewing now and bam explodes in my face but if i just reset my sessions then it all goes back to normal but until then i get that error
indices are (not indexes, indices right?)
$change and $_SESSION['lang']
if $_SESSION['lang'] doesn't exist, it will be NULL, and NULL is not a valid index in an array... illegal (evil cops with batons will knock on your door)
keep the police from even knowing that i could do a illigal operation? and this is the only session that seams to go all crazy, all the other sessions work fine
The only way to create illegal offsets is NULL/boolean/object/resource/array (I think) ... uhm something more ... and none of those (perhaps boolean) sounds like they could be accidentally set, as I said, dump all variables $_SESSION['lang'] and so on, and when it freaks, you'll see what they were.
o dear god. it happened and i had the var_dump and whatnot. what happens is that for whatever god aweful reason the $_SESSION['lang'] gets set to the entire array of possible words instead of just being eng or est. that makes absolutly no sence to me. Here is all the functions that are in my language class
last bump. Does nobody have and ideas or anything? maybe you need to see the entire script and if so pm/msn/aim me and i will show you more (its too long of files to put here) but i really need help on this because its completly got me stumped.