PHP $_POST Variables
<p>Here's a gallery page: <a href="http://www.metroscap.com/chicago-black-and-white-photos.php" rel="nofollow">http://www.metroscap.com/chicago-black-and-white-photos.php</a>
Here's a detail page: <a href="http://www.metroscap.com/chicago/1203/traffic-on-michigan-avenue-at-monroe.php" rel="nofollow">http://www.metroscap.com/chicago/1203/traffic-on-michigan-avenue-at-monroe.php</a></p>

<p>I'm attempting to submit the following data: (but this button will have about 15 varieties per page.  Each of my photos has its own page. (see the detail page and the products in the accordion on the right side -- Each photo has about 25 different framed size options that i've built CSS classes for.  I wish to be able to have people submit multiple framed sizes of multiple pictures to my rudimentary drag and drop wall so that they can compare photos and their framed size to one another.</p>

<p>so for example, someone could submit a 42" x 42" version of Columbus | "Leveled", and two 27" versions of Atlanta | "Atlanta" and Chicago | "Monroe" on a dark blue wall.)</p>

<p>Here is the button code i'm submitting or would wish to submit for each size/frame variety for each picture, here are two buttons.</p>

<pre><code>&lt;form action="http://localhost:8888/drag-drop-test2.php" method="post" style="width: 200px; height: 200px;"&gt;
&lt;input type="hidden" name="widthHeightTotal" value="424"  /&gt;
&lt;input type="hidden" name="picture" value="http://www.metroscap.com/images/bigJPEGS/columbus/Leveled.jpg" /&gt;
&lt;input type="hidden" name="ddClass" value="TPC42test" /&gt;
&lt;input type="hidden" name="widthHeight" value="354" /&gt;
&lt;input type="submit" value="Add to Wall" /&gt;
&lt;/form&gt;

&lt;form action="http://localhost:8888/drag-drop-test2.php" method="post" style="width: 200px; height: 200px;"&gt;
&lt;input type="hidden" name="widthHeightTotal" value="324"  /&gt;
&lt;input type="hidden" name="picture" value="http://www.metroscap.com/images/bigJPEGS/columbus/Leveled.jpg" /&gt;
&lt;input type="hidden" name="ddClass" value="TPC32test" /&gt;
&lt;input type="hidden" name="widthHeight" value="300" /&gt;
&lt;input type="submit" value="Add to Wall" /&gt;
&lt;/form&gt;
</code></pre>

<p>now on the drag-drop-test2.php page i wish to simply use a foreach loop to ether print_r or echo through each framed size the user wished to drag around and compare on the wall with this echo statement</p>

<pre><code> echo "&lt;div class=\"drag\" style=\"left:20px; height: ".$widthHeightTotal."px;\"&gt;&lt;img src=\"".$picture."\" class=\"".$ddClass."\" width=\"".$widthHeight."\" height=\"".$widthHeight."\" /&gt;&lt;/div&gt;"; 
</code></pre>

<p>I can get this working if i'm only submitting one picture to the wall.  I simply cannot wrap my brain around walking through the $_POST or $_SESSION array to make this behave the way i intend.</p>

<p>maybe php isn't my best solution for this, maybe it's jquery. i don't know for sure. i'm not necessarily a programmer or developer, but i know enough to be dangerous to myself, especially if it's a sharp $obj.</p>

<p>------------- UPDATED -----------
i've removed the brackets from the button code.</p>

<p>Ok, before posting here i've struggled with this for a week with the foreach statement.  when i do exactly this (as suggested):</p>

<pre><code>foreach ($_POST as $key =&gt; $value) {
$$key = $value;
echo "&lt;div class=\"drag\" style=\"left:20px; height: ".$widthHeightTotal."px;\"&gt;&lt;img src=\"".$picture."\" class=\"".$ddClass."\" width=\"".$widthHeight."\" height=\"".$widthHeight."\" /&gt;&lt;/div&gt;";
}
</code></pre>

<p>Here is what's output:</p>

<pre><code>&lt;div class="drag" style="left:20px; height: 324px;"&gt;&lt;img src="" class="" width="" height="" /&gt;&lt;/div&gt;
&lt;div class="drag" style="left:20px; height: 324px;"&gt;&lt;img src="http://www.metroscap.com/images/bigJPEGS/columbus/Leveled.jpg" class="" width="" height="" /&gt;&lt;/div&gt;
&lt;div class="drag" style="left:20px; height: 324px;"&gt;&lt;img src="http://www.metroscap.com/images/bigJPEGS/columbus/Leveled.jpg" class="TPC32test" width="" height="" /&gt;&lt;/div&gt;
&lt;div class="drag" style="left:20px; height: 324px;"&gt;&lt;img src="http://www.metroscap.com/images/bigJPEGS/columbus/Leveled.jpg" class="TPC32test" width="300" height="300" /&gt;&lt;/div&gt;
</code></pre>

<p>Four instances of the echo line, and only depositing one value per loop until the entire line is finally populated with the correct values by the fourth iteration.  I simply don't understand the logic of what's happening here in the foreach.  EVEN at this though, when i try to return to my button page and add a different item to the page, i don't get 8 items of two different things (four of each) i only get the one item.  </p>

<p>If all I wanted was just one item on this page at one time i'd just have one echo line on the page and just make my echo line be:</p>

<pre><code>echo "&lt;div class=\"drag\" style=\"left:20px; height: ".$_POST['widthHeightTotal']."px;\"&gt;&lt;img src=\"".$_POST['picture']."\" class=\"".$_POST['ddClass']."\" width=\"".$_POST['widthHeight']."\" height=\"".$_POST['widthHeight']."\" /&gt;&lt;/div&gt;";
</code></pre>

<p>and not worry about putting that line in a foreach or do...while because i'd only ever want one item on the page.  </p>

<p>what I want is to be able to have 35 (that's overkill but i overkill to make a point) differnent pictures end up on this page. and actually, ideally, at 35 different sizes.</p>

<p>i'm clearly dumber than i think i am apparently.</p>
