Just be sure you call session_start() on any page you want to access
session variables. 

Then you can set a variable by doing

$_SESSION["myvariable"] = "hello";

and then you can use $_SESSION["myvariable"] anywhere you want. 

This assumes the latest version of PHP. The procedure is similar on
older versions, you just have to use session_register().

---John Holmes...

> -----Original Message-----
> From: Christian Ista [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 25, 2002 4:45 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Session question
> 
> Hello,
> 
> I'm a newbie in PHP, I use a lot ColdFusion (at work).
> 
> With ColdFusion, it's very easy to create and use session variable. I
do
> something like that :
> <cfset session.myvariable = "hello"> and this variable can be use
> everywhere.
> 
> Could you tell me how that's work in PHP. I saw in help file
> session.start.
> But it's not very clear for me.
> 
> Thanks for your help,
> 
> Bye
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to