Tedd's SESSION Array Demo (Page 2)

   Array
(
    [count] => 1
)
    


GOTO Page 1

Please note -- This script is receiving an array from a SESSION. The values in the array are extracted from the SESSION to populate local variables. Also note, the count variable is increased by one and placed back into the SESSION array. This SESSION is then ready to be passed back to the first page.

This process demonstrates how variables can be passed from one page to another via a SESSION array.

 

CODE FOLLOWS

<?php
    session_name
("sperlt");
    
session_start();

    include(
'includes/header.php');

    
error_reporting(E_ALL);    // set error reporting to all

    
$count = isset($_SESSION['count']) ? $_SESSION['count'] : 0;

    
$count++;
    
$_SESSION['count'] = $count;

?>


    <h1>Tedd's SESSION Array Demo (Page 2)</h1>

    <pre>
   <?php
       print_r
($_SESSION);
   
?>
    </pre>

    <br>
    <br>
    <a href="session-array-page1.php">GOTO Page 1</a>

    <p>
        Please note -- This script is receiving an array from a SESSION. The values
        in the array are extracted from the SESSION to populate local variables.
        Also note, the count variable is increased by one and placed back into
        the SESSION array. This SESSION is then ready to be passed back to the first page.
    </p>

    <p>
        This process demonstrates how variables can be passed from one page to another
        via a SESSION array.
    </p>

<?php
    
include('includes/footer.php');
?>