Categories

PHP session variables

Managing session variables in PHP is really easy.
First thing to do is to initialise the variable. For instance

$_SESSION["myvariable"] = myvalue;

To use it, in another page, you can then just use $_SESSION["myvariable"].
Just remember to put at the top of the code this instruction:

session_start();

Actually, this will not re-initialise the session, but will create the session object with the current session variables.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Cyberactiva web development - Blogged