[PHP] Re: session class

2001-12-27 Thread Chris Hall

session variables are accessible the same as when you set them : eg
session_register('temp');
$temp = 1;

on another page:

session_start(); /* so that you can access your session variables...
echo $temp; /* this will echo 1

and so you know you cannot define a variable for your class inside a
function (method)

Christian Haines [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 (sorry if this has been posted a thousand times..i am having problems
 posting)

 hi all,

 how does one access and manipulate session variables from within a class?
 i have hunted the net high and low but received no relief.

 i have tried (where error is a session variable)

 class test
 {
 var $global['error'];
 }

 class test
 {
 var $HTTP_SESSION_VARS['error'];
 }

 class test
 {
 session_register(error);
 var $error;
 }

 all to no avail.

 please help!

 many thanks in advance,
 christian




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: session class

2001-12-21 Thread Yasuo Ohgaki

Christian Haines wrote:

  (sorry if this has been posted a thousand times..i am having problems
  posting)
 
  hi all,
 
  how does one access and manipulate session variables from within a class?
  i have hunted the net high and low but received no relief.
 
  i have tried (where error is a session variable)
 
  class test
  {
  var $global['error'];
  }


This is wrong.

 
  class test
  {
  var $HTTP_SESSION_VARS['error'];
  }


This is wrong thing to do also


 class test
 {
 session_register(error);
 var $error;
 }
 

This is also wrong, too

Try to find example code. There are many of them on net.

-- 
Yasuo Ohgaki


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]