请问在php中如何把上个页面生成的对象实例传到下个页面
//命名为1.php<?php
class test
{
var $one ="initial";
function get_one(){
return $this->one;
}
function set_one($info){
$this->one=$info;
}
}
?>
//命名为2.php
<?php
require_once('1.php');
$testinstance = new test;
$test1=$testinstance->get_one();
echo $test1;
echo "<br>";
echo "<br>";
$testinstance->set_one("change");
$test1=$testinstance->get_one();
echo $test1;
echo "<br>";
echo "<br>";
echo "<a href=3.php>第三个页面</a>";
?>
//命名为3.php
<?php
require_once('1.php');
$test2=$testinstance->get_one();
echo $test2;
?>
运行到3.php后,出现结果是initial值,如果我想出现'change'值,应该如何调用, 谢谢
页:
[1]