[Phplib-users] Save session variable with custom_session
Brought to you by:
nhruby,
richardarcher
From: Serghej P. <sp...@ti...> - 2003-03-24 16:15:24
|
Hello=20 I have some problem to access variable saved into sesion from template custom class. If I don't declare $country_selected as global inside Start_Body function this code don't work. By the way $_SESSION["country_selected"] is ok and $sess->is_registered(country_selected) is setted But $this->setVar("country_key",$country_selected) - don't work; Please help=20 Serghej <? page_open(array("sess" =3D> "Example_session", "auth" =3D> = "Example_Auth", "perm" =3D> "Example_Perm", "user" =3D> "Example_User")); class HTMLBody extends Template_PHPLIB { =20 function Start_Body($key) { global $sess; =20 =20 $this->Template_PHPLIB(); $this->Tintra_Body(TEMPLATE_DIR); $this->setFile( array( "MainbodyT_key" =3D> "HomeBody.tpl")); =20 if ( isset($_GET[country_id]) && ($_SESSION["country_selected"] !=3D $_GET[country_id]) ) { =20 $country_selected =3D $_GET[country_id]; # $_SESSION["country_selected"] =3D $country_selected; $sess->register("country_selected"); $this->setVar("country_key",$country_selected); } } } $t =3D new HTMLBody(); $page_setting =3D array( "title_key" =3D> "Home Page", "page_code" =3D> "0001", "check_user" =3D> "true", ); $theApp=3D$t->Start_Body($page_setting); $t->pParse("output","MainbodyT_key"); ?> |