Store Array Variables Through Page Refresh with PHP
<p>So this is the second assignment in a beginner PHP class. One part of the assignment requires you to allow the user to enter in multiple walls in an HTML form (the program is a calculator to figure out the cost of paint, labor, etc.), however you don't know how many walls the person is going to enter, so the form needs to be dynamic.</p>

<p>I don't think we're allowed to use javascript.</p>

<p>I've tried to use the SESSION variable to store the values into an array ( <a href="http://stackoverflow.com/questions/7964917/how-to-store-variable-values-over-multiple-page-loads">how to store variable values over multiple page loads</a> ) and use foreach functions to loop and save the data ( <a href="http://stackoverflow.com/questions/3045619/need-to-store-values-from-foreach-loop-into-array">need to store values from foreach loop into array</a> ).</p>

<p>Nothing seems to be working. In this assignment we're not supposed to use SQL.</p>

<p>Is there another way to store an array? I'd also be happy with a way to echo the data and leave it there until the cache is cleared.</p>

<p>Here's the code I  have right now (sorry it's a bit of a mess):</p>

<pre><code>print_r($_POST);
      echo "&lt;br /&gt;";
      print_r($_REQUEST['wallW']);
      echo "&lt;br /&gt;";

      echo "&lt;br /&gt;";
      $wallW = $_REQUEST['wallW'];         
      echo "The width is $wallW.";
      echo "&lt;br /&gt;";      
      print_r($wallW);

       $_SESSION['wallW'] = $wallW;
        $wallW = $_SESSION['wallW'];


    ?&gt;


            &lt;form name="getOrderInfo" action="" onsubmit="" method="post"&gt;
            &lt;table id="wallInfo"&gt;
                &lt;th&gt;
                    Order Information
                &lt;th&gt;
                &lt;tr&gt;
                    &lt;td&gt;
                        Wall Width:
                    &lt;/td&gt;
                    &lt;td&gt;
                        &lt;input type="text" name="wallW[]" id="wallW" size="20"  value=""&gt;
                    &lt;/td&gt;
                &lt;tr&gt;

                &lt;tr&gt;
                    &lt;td&gt;
                        Wall Length:
                    &lt;/td&gt;
                    &lt;td&gt;
                        &lt;input type="text" name="wallL[]" id="wallL" size="20"  value=""&gt;
                    &lt;/td&gt;
                &lt;tr&gt;

            &lt;/table&gt;


        &lt;input type="submit" value="Add Wall"&gt;
&lt;/form&gt;
</code></pre>

<p>Any help would be great.
Thanks,
Chelsea</p>
