Assuming PHP >= 4.1

page1.php

<?
// continue or create a session
session_start();

// set some session vars
$_SESSION['color'] = 'red';
$_SESSION['name'] = 'Justin';
?>


page2.php

<?
// continue or create a session
session_start();

// echo some session vars
echo "Hello {$_SESSION['name']}, your favourite color is
{$_SESSION['color']}";

// clear some session vars
unset($_SESSION['name']);

// modify some session vars
$_SESSION['color'] = 'blue';
?>


Similar tests can all be found on [url]http://au.php.net/session[/url]


Justin



On Friday, September 19, 2003, at 12:22 PM, Patrik Fomin wrote:
> Hi,
>
> can anyone help my list the ways to create/view a session, i need to
> find
> out if my host supports any of em (kinda strange host), eg:
>
> page1.php
>
> start_session["test"]
> register_session["test2"]
> etc
>
> page2.php
>
> retrive session 1, 2 etc and display their contents
>
> regards
> patrick
>
> --
> PHP General Mailing List ([url]http://www.php.net/[/url])
> To unsubscribe, visit: [url]http://www.php.net/unsub.php[/url]
>
> ---
> [This E-mail scanned for viruses]
>
>