SESSIO variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wiert Dijkkamp

    SESSIO variables

    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

    #2
    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

    Comment

    • Colin McKinnon

      #3
      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.

      Comment

      Working...