Don't forget that variable names are case sensitive. $_session is not the same as $_SESSION. The latter is the correct way to reference the session superglobal. Don't use the long names... $HTTP_*_VARS... these aren't going to exist in PHP 5. If you are using PHP prior to version 4.2.0.. write a script that transfers the old long variable names to the short ones. If you need us to elaborate more on that just ask.
<?php
// file1.php
session_start();
$_SESSION["var1"] = (int) 0;
echo "session created";
?>
You need to make a call to session_start() at the beginning of every page which requires the use of sessions. This function will create a cookie and alter the outgoing HTTP response headers and as such should be called before any output is sent from the page. And the opening <?php delimiter should have no white space before it. Session register should not be used... (PHP 4.2.0 and greater) here is a page that discusses why.
http://p2p.wrox.com/topic.asp?TOPIC_ID=2052
<?php
//file2.php
session_start();
echo $_SESSION["var1"];
// Two plus signs will post-increment and assign that value to the variable
$_SESSION["var1"]++;
?>
This method also requires that you have cookies enabled in your browser. Otherwise you will need to pass the session id to each page that requires use of sessions via a url embedded argument.
echo "<a href='file2.php?".SID."'>file 2</a>";
or
echo "<a href='file2.php?sid=".session_id()."'>file2</a>";
And finally the PHP manual page on sessions
http://www.php.net/session
: )
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::