What is wrong with the session variables

I have no idea whats wrong with the session variables in my code…Here is a snippet:

file 1:


    function display_test(){
        if(isset($_SESSION['testing']['testing'])) echo $_SESSION['testing']['testing'];

        echo "<br><br><br><form id="current_juices_form" method="post" action="file2.php">
                <input type="submit" />

File 2(the file the above form is getting submitted too):


function testing(){
    $_SESSION['testing']['testing'] = "<br>testing<br>";
    header("Location:  file1.php");

For some reason when redirecting back to file1 after file2 is done processing post action, it’s not printing out the session variable $_SESSION[‘testing’][‘testing’]…what is going on???

Source: forms

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.