PHP Using session variables in array(s)
<p>My question is how do i put these session variables into a array? I have tried countless ways but none of them work.<br>
Not really sure what to put in a array and what no and how to adress them.<br>
Currently when i fill in the form the data gets displayed in a table.</p>

<p>Next when i press the hyperlink that takes me back to the same form, i wish to enter data again.<br>
This data should be added in a new row in the same display table.  </p>

<p>Best Regards.</p>

<p>The code below (pardon me that it is not english).</p>

<pre><code>&lt;?php
session_start();
?&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0            Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;

&lt;head&gt;
&lt;title&gt;ExpoFormulier&lt;/title&gt;
</code></pre>

<p>
    </p>

<pre><code>&lt;body&gt;

&lt;?php
if (!empty($_POST))
{
$standnaam = $_POST["standnaam"];
$oppervlakte = $_POST["oppervlakte"];
//value in the form van checkboxes op 1 zetten!
$verdieping = isset($_POST["verdieping"]) ? $_POST["verdieping"] : 0;  
$telefoon = isset($_POST["telefoon"]) ? $_POST["telefoon"] : 0;  
$netwerk = isset($_POST["netwerk"]) ? $_POST["netwerk"] : 0; 


if (is_numeric($oppervlakte)) 
{
    $_SESSION["standnaam"]=$standnaam;
    $_SESSION["oppervlakte"]=$oppervlakte;
    $_SESSION["verdieping"]=$verdieping;
    $_SESSION["telefoon"]=$telefoon;
    $_SESSION["netwerk"]=$netwerk;
    header("Location:ExpoOverzicht.php"); 
}
else 
{
    echo "&lt;h1&gt;Foute gegevens, Opnieuw invullen a.u.b&lt;/h1&gt;";
}  
}

?&gt;

&lt;form action="&lt;?php echo $_SERVER["PHP_SELF"]; ?&gt;" method="post" id="form1"&gt;
&lt;h1&gt;Vul de gegevens in&lt;/h1&gt;
&lt;table&gt;
    &lt;tr&gt;
        &lt;td&gt;Standnaam:&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="standnaam" size="18"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Oppervlakte (in m^2):&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" name="oppervlakte" size="6"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Verdieping:&lt;/td&gt;
        &lt;td&gt;&lt;input type="checkbox" name="verdieping" value="1"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Telefoon:&lt;/td&gt;
        &lt;td&gt;&lt;input type="checkbox" name="telefoon" value="1"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;Netwerk:&lt;/td&gt;
        &lt;td&gt;&lt;input type="checkbox" name="netwerk" value="1"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;td&gt;&lt;input type="submit" name="verzenden" value="Verzenden"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;

&lt;/form&gt;
</code></pre>

<p>Second File:</p>

<pre><code>&lt;?php
session_start();
?&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;

&lt;head&gt;
    &lt;title&gt;ExpoOverzicht&lt;/title&gt;
 &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
    &lt;link href="StyleSheetExpo.css" rel="stylesheet" type="text/css" /&gt;  
&lt;/head&gt;

&lt;body&gt;

&lt;h1&gt;Overzicht van de ingegeven standen in deze sessie&lt;/h1&gt;

&lt;?php

$standnaam = $_SESSION["standnaam"];
$oppervlakte = $_SESSION["oppervlakte"];
$verdieping = $_SESSION["verdieping"];
$telefoon = $_SESSION["telefoon"];
$netwerk = $_SESSION["netwerk"];

$result1 = 0; 
$result2 = 0;
$result3 = 0;
$prijsCom = 0;
$prijsVerdieping = 0;

for ($i=1; $i &lt;= $oppervlakte; $i++)
{   
    if($i &lt;= 10)
    {
       $tarief1 = 1 * 100;
       $result1 += $tarief1;
    }

    if($i &gt; 10 &amp;&amp; $i &lt;= 30)
    {
        $tarief2 = 1 * 90;
        $result2 += $tarief2;      
    }

    if($i &gt; 30)
    {
        $tarief3 = 1 * 80;
        $result3 += $tarief3;
    }  
}
$prijsOpp = $result1 + $result2 + $result3;


if($verdieping == 1)
{
    $prijsVerdieping = $oppervlakte * 120;
}


if(($telefoon == 1) || ($netwerk == 1))  
{
    $prijsCom = 20;
}

if(($telefoon == 1) &amp;&amp; ($netwerk == 1))
{
    $prijsCom = 30;
}


$totalePrijs = $prijsOpp + $prijsVerdieping + $prijsCom; 

echo "&lt;table class=\"tableExpo\"&gt;";

    echo "&lt;th&gt;Standnaam&lt;/th&gt;";
    echo "&lt;th&gt;Oppervlakte&lt;/th&gt;";
    echo "&lt;th&gt;Verdieping&lt;/th&gt;";
    echo "&lt;th&gt;Telefoon&lt;/th&gt;";
    echo "&lt;th&gt;Netwerk&lt;/th&gt;";
    echo "&lt;th&gt;Totale prijs&lt;/th&gt;";

        echo "&lt;tr&gt;";     
            echo "&lt;td&gt;".$standnaam."&lt;/td&gt;";
            echo "&lt;td&gt;".$oppervlakte."&lt;/td&gt;";
            echo "&lt;td&gt;".$verdieping."&lt;/td&gt;";
            echo "&lt;td&gt;".$telefoon."&lt;/td&gt;";
            echo "&lt;td&gt;".$netwerk."&lt;/td&gt;";
            echo "&lt;td&gt;".$totalePrijs."&lt;/td&gt;";
        echo "&lt;/tr&gt;";

echo "&lt;/table&gt;";

?&gt;

&lt;a href="ExpoFormulier.php"&gt;Terug naar het formulier&lt;/a&gt;

&lt;/body&gt;
&lt;/html&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>
