Connecting Tech Pros Worldwide Help | Site Map

SESSIO variables

Wiert Dijkkamp
Guest
 
Posts: n/a
#1: Jul 17 '05
Wan a headache? Get mine!

The code
echo "<br>before: ".$_SESSION['var1'];// -> outputs the correct value
$_SESSION['var2'] = $something;
echo "<br>after: ".$_SESSION['var1'];// -> outputs another value

The obvious question: How can that be?

--
wiert
Oli Filth
Guest
 
Posts: n/a
#2: Jul 17 '05

re: SESSIO variables


Wiert Dijkkamp said the following on 06/06/2005 15:22:[color=blue]
> Wan a headache? Get mine!
>
> The code
> echo "<br>before: ".$_SESSION['var1'];// -> outputs the correct value
> $_SESSION['var2'] = $something;
> echo "<br>after: ".$_SESSION['var1'];// -> outputs another value
>
> The obvious question: How can that be?[/color]

Difficult to say unless you post the actual code!


--
Oli
Colin McKinnon
Guest
 
Posts: n/a
#3: Jul 17 '05

re: SESSIO variables


Wiert Dijkkamp wrote:
[color=blue]
> Wan a headache? Get mine!
>
> The code
> echo "<br>before: ".$_SESSION['var1'];// -> outputs the correct value
> $_SESSION['var2'] = $something;
> echo "<br>after: ".$_SESSION['var1'];// -> outputs another value
>
> The obvious question: How can that be?
>[/color]

because:

$ar=array();
$ar['var1']=1;
$ar['var2']=& $ar['var1'];
$ar['var2']='hello';
print $ar['var1'];

?

C.
Closed Thread