this script don't work
Script A: set session variable
<?php
class Page0A {
function Page0A(){
$this->init();
$this->save();
header("Locatio n: page0b.php");
}
function init(){
session_start() ;
}
function save(){
global $_SESSION;
$_SESSION["name"] = "fabio";
}
}
$p = new Page0A();
?>
Script B retrive variable
<?php
class Page0B{
function Page0B(){
$this->init();
$this->display();
}
function init(){
session_start() ;
}
function display(){
global $_SESSION;
echo $_SESSION["name"];
}
}
$p = new Page0B();
?>
this NOT WORK for me ! i don't undestand!
Script A: set session variable
<?php
class Page0A {
function Page0A(){
$this->init();
$this->save();
header("Locatio n: page0b.php");
}
function init(){
session_start() ;
}
function save(){
global $_SESSION;
$_SESSION["name"] = "fabio";
}
}
$p = new Page0A();
?>
Script B retrive variable
<?php
class Page0B{
function Page0B(){
$this->init();
$this->display();
}
function init(){
session_start() ;
}
function display(){
global $_SESSION;
echo $_SESSION["name"];
}
}
$p = new Page0B();
?>
this NOT WORK for me ! i don't undestand!
Comment