this is as simple and complex as it gets.

session_start;
session_register("my_var");

now say we do:

$my_var = 5;

any script, page, whatever you serve that calls $my_var will return 5.
Once you change the variable, $my_var will now be that new value in every
bit of code.

All you have to do is call session_start; on every script that will use your
session variable.

ONLY call session_register() ONCE for each of your variables. If you call it
once on one script and the variable it set to 5. And then you register is
again it will lose the value and will be reset. So, usually you test for it
in an include (which contains you session_start;).

if (!isset($my_var)) session_register("my_var");

Easy cheesey.





----- Original Message -----
From: Evelio Martinez <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 09, 2001 10:57 AM
Subject: [PHP] HOWTO handle sessions ?


>
> Hi!
> Does anyone know of some good examples of sessions?
>
>
> --
> Evelio Martínez
>
>
> --
> 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 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]

Reply via email to