[Chameleon] how to read user variables in scripts files diferents to template file

Alexys Herleym Rodriguez Avellaneda alexys_6 at yahoo.es
Sat Jun 30 18:07:42 EDT 2007


Hi,

In the Initialization Script i declare my own variable:
..
..
$oApp->CWCInitialize( $szTemplate, $szMapFile);
$oApp->setVar( 'SID', session_id() );
$oApp->setVar( 'CI', TRUE );
...

In the template file i can read the SID or CI variable (my own variables):
[$SID|$]
[$CI|$]

When i call one php page from template file and i need to read the chameleon session variables i do:

1- i pass the SID in the url: 
   login.phtml?sid=[$SID|$]
2- and i call the chameleon session in the php file (login.phtml):
  <?
   include_once("../../chameleon/htdocs/widgets/session.inc.php");
   installSessionDirectoryHandler();
    initializeSession();
   ..
   ..
  ?>

Then i can use all chameleon session variables with $_SESSION from (inside) login.phtml :
<?
   include_once("../../chameleon/htdocs/widgets/session.inc.php");
   installSessionDirectoryHandler();
    initializeSession();
    //all chameleon variables
    print_r ($_SESSION);
   //only one chameleon variable
    print_r ($_SESSION['gszAppPath']);
?>

But i need to know how to see my own CI or SID variable inside login.phtml?. This code doesn't work:
<?
   include_once("../../chameleon/htdocs/widgets/session.inc.php");
   installSessionDirectoryHandler();
    initializeSession();
   //this doen't work
    echo $_SESSION['CI'];
   //this doen't work
    echo $_GLOBALS['CI'];
   //this doen't work
    echo $_POST['CI'];
?>
<!--    //this doen't work -->
<a href="somewhere.php?sid=[$CI|default$]">link</a>

And this code in the Initialization Script: $oApp->setVar( 'CI', TRUE ); mean that CI is a session variable?, or is a chameleon session variable? or both?, or none?

Thanks a lot.

Alexys


       
____________________________________________________________________________________
¡Descubre una nueva forma de obtener respuestas a tus preguntas!
Entra en Yahoo! Respuestas.
http://es.answers.yahoo.com/info/welcome
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20070630/eac2865f/attachment.html


More information about the Chameleon mailing list