Hey Casper, long time no see....
keep the code snips coming.. your explainiation was ok, but without the code to look at we can't do much here for you..
Punchline: even when accessing array values, use quotes around all strings.
$array['string'] not $array[string]
Notice: Use of undefined constant hiddennews - assumed 'hiddennews' in c:\program files\apache group\apache\htdocs\black rain\news.php on line 41
(note I am using $_POST[string] for the variable)
Here is an example which replicates your problem
<?php
error_reporting(E_ALL);
define('ConstA','a');
$array = array( ConstA => 'foo',
'ConstB' => 'bar' );
echo '<br />';
print $array[ConstA];
echo '<br />';
print $array[ConstB];
echo '<br />';
print_r($array);
?>
html output:
foo
Notice: Use of undefined constant ConstB - assumed 'ConstB' in /usr/local/apache2/htdocs/test/const.php on line 16
bar
Array ( [a] => foo [ConstB] => bar )
always wrap strings in quotes: '' or ""
if you leave them out, php thinks you are referencing something you defined using the define() function.
PHP searches and finds a ConstA, evaluates it to 'a', and uses it as the string 'a'
$array[ConstA]
$array['a']
PHP searches and cannot find ConstB, so it assumes you messed up and tries 'ConstB', finds that works, and goes with it.
$array[ConstB]
$array['ConstB']