My $_SESSION variable will not hold its value. Any Ideas on why?
<p>I want it to increment and decrement the value in <code>$_SESSION['selection']</code>.<br>
Mousedown on next form results in: "<em>The session is 1</em>".<br>
Mousedown on previous form results in "<em>The session is -1</em>".</p>

<p>Here is the code:  </p>

<pre><code>  &lt;?php

    if (isset($_POST['next'])) {
      displaynext();
    }
    else if (isset($_POST['previous'])) {
      displayprevious();
    }
    else {
      session_start();
      echo "session started";
      $_SESSION['selection'] = 1;
    }

    function displaynext() {
      $_SESSION['selection'] = $_SESSION['selection'] + 1;
      echo "The session is $_SESSION[selection]";
    }

    function displayprevious() {
      if ($_SESSION['selection'] != 1) {
        $_SESSION['selection'] = $_SESSION['selection'] - 1;
      }
      echo "The session is $_SESSION[selection]";
    }

    ?&gt;

    &lt;form action="&lt;?=$_SERVER['PHP_SELF'];?&gt;" method="post"&gt;
      &lt;input type="submit" name="previous" value="Previous"&gt;
    &lt;/form&gt;

    &lt;form action="&lt;?=$_SERVER['PHP_SELF'];?&gt;" method="post"&gt;
      &lt;input type="submit" name="next" value="Next"&gt;
    &lt;/form&gt;
</code></pre>
