session_test.php
<?php
session_start();
$_SESSION['IDNO']='A1234';
$_SESSION['DPT_COD'][0]='1402';
$_SESSION['DPT_COD'][1]='B402';
Print_r($_SESSION);
echo "<br /><a href=\"session_test2.php\">next!</a>";
?>
The browser show:
Array ( [IDNO] => A1234 [DPT_COD] => Array ( [0] => 1402 [1] => B402 ) )
next!
session_test2.php
<?phpIn machine 1
session_start();
echo "Original SESSION array values:<br />";
Print_r($_SESSION);
echo "<br /><br />";
echo "New SESSION array values:<br />";
$IDNO='Z5678';
$DPT_COD='foobar';
Print_r($_SESSION);
session_unset();
session_destroy();
?>
The browser show:
Original SESSION array values:
Array ( [IDNO] => A1234 [DPT_COD] => Array ( [0] => 1402 [1] => B402 ) )
New SESSION array values:
Array ( [IDNO] => Z5678 [DPT_COD] => foobar )
In machine 2
The browser show:
Original SESSION array values:
Array ( [IDNO] => A1234 [DPT_COD] => Array ( [0] => 1402 [1] => B402 ) )
New SESSION array values:
Array ( [IDNO] => A1234 [DPT_COD] => Array ( [0] => 1402 [1] => B402 ) )
But I don't know why macheine 1 show that diffrent result.
The answer is someone turn on register_globals in php.ini in machine 1.
沒有留言:
張貼留言