Does using $_SERVER['PHP_SELF'] reset the session?
<p>I am finding that the session value is being reset each time I submit the form. The snippet is as follows:</p>

<pre><code> &lt;? php session_start(); ?&gt;
&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
if($_SESSION['idi']=="")
{
$_SESSION['idi'] = $_GET['id6'];
$_SESSION['class1'] = $_GET['class6'];
$_SESSION['section1'] = $_GET['section6'];
}
echo $_SESSION['idi'].' '.$_SESSION['class1'].' '.$_SESSION['section1'].'&lt;br&gt;';
print session_id(); 
?&gt;
&lt;form method="post" action=""&gt;
&lt;table&gt;
&lt;tr&gt;
    &lt;td&gt; &lt;label&gt; CLASS NAME &lt;/label&gt;
    &lt;td&gt;&lt;input type="text" name="class_name" value="&lt;?php echo $_SESSION['class1'] ;?&gt;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;&lt;label&gt; SECTION &lt;/label&gt;
    &lt;td&gt;&lt;input type="text" name="section" value="&lt;?php echo $_SESSION['section1'] ;?&gt;"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
    &lt;td&gt;
        &lt;input type="submit" value="UPDATE" name="update1" &gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/form&gt;
&lt;?php
    if(isset($_POST['update1'])){
        $class_name = $_POST['class_name'];
        $section = $_POST['section'];
        update_data($_SESSION['idi'],$_POST['class_name'],$_POST['section']);
        echo 'did='.$_SESSION['idi'].' class1='.$_SESSION['class1'].' section1='.$_SESSION['section1'].'&lt;br&gt;';
    }

function update_data($id1,$class1,$section1)
    {
        echo'suresh &lt;br&gt;';
        echo $id1.' '.$class1.' '.$section1.'&lt;br&gt;';
        $dbc = mysqli_connect('localhost','root','','cce')
                    or die('Error connecting to MySQL server');

        $query = "SELECT * FROM class";
        $result = mysqli_query($dbc,$query)
                    or die("Error connecting to database1");

        //while($row = mysqli_fetch_array($result))
        //{
            echo'TEST&lt;br&gt;';
            $query="UPDATE class SET class_name='".$class1."', class_section='".$section1."' WHERE id = '".$id1."'";
            $result = mysqli_query($dbc,$query)
                    or die("Error connecting to database2");
            echo'TEST2&lt;br&gt;';
        //}
        mysqli_close($dbc); 
    }
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>The problem is each time I submit the form, I am expecting to see the same session value printed out. BUT as soon as I hit submit, the value disappears and prints nothing...
However IF I MAKE action="" in the form THEN each time I submit the form the value of <code>$_SESSION['abc']</code> is still the same, 99.</p>

<p>Why is this? Does <code>$_SERVER['PHP_SELF']</code> reset the session? Or is it anything in the configuration?</p>
